banjina 发表于 2015-9-16 10:19:46

puppet 横向扩展(二)

# master-1 上执行, 清理log, 重启 apache2 服务  root@master-1:~# rm/var/log/apache2/* -rf
  root@master-1:~# service apache2 restart
  [ ok ] Restarting web server: apache2 ... waiting .
  root@master-1:~# ll /var/log/apache2/
  total 4
  -rw-r--r-- 1 root root   0 Jan7 20:14 access.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 balancer_access.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 balancer_error.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 balancer_ssl_requests.log
  -rw-r--r-- 1 root root 155 Jan7 20:14 error.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 other_vhosts_access.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 puppetmaster_worker_access_1.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 puppetmaster_worker_access_2.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 puppetmaster_worker_error_1.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 puppetmaster_worker_error_2.log
  
  # master-2 上执行, 清理log, 重启 apache2 服务
  root@master-2:/etc/apache2/sites-enabled# rm /var/log/apache2/* -rf
  root@master-2:/etc/apache2/sites-enabled# service apache2 restart
  [ ok ] Restarting web server: apache2 ... waiting .
  root@master-2:/etc/apache2/sites-enabled# ll /var/log/apache2/
  total 4
  -rw-r--r-- 1 root root   0 Jan7 20:15 access.log
  -rw-r--r-- 1 root root 155 Jan7 20:15 error.log
  -rw-r--r-- 1 root root   0 Jan7 20:15 other_vhosts_access.log
  -rw-r--r-- 1 root root   0 Jan7 20:15 puppetmaster_worker_access.log
  -rw-r--r-- 1 root root   0 Jan7 20:15 puppetmaster_worker_error.log
  
  # node-1 上执行
  root@node-1:~# puppet agent -t
  Info: Retrieving pluginfacts
  Info: Retrieving plugin
  Info: Caching catalog for node-1.puppet.com
  Info: Applying configuration version '1420633009'
  Notice: Finished catalog run in 0.02 seconds
  
  # master-1 上查看 log 结果
  root@master-1:~# ll /var/log/apache2/
  total 20
  -rw-r--r-- 1 root root   0 Jan7 20:14 access.log
  -rw-r--r-- 1 root root 821 Jan7 20:16 balancer_access.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 balancer_error.log
  -rw-r--r-- 1 root root 903 Jan7 20:16 balancer_ssl_requests.log
  -rw-r--r-- 1 root root 155 Jan7 20:14 error.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 other_vhosts_access.log
  -rw-r--r-- 1 root root 300 Jan7 20:16 puppetmaster_worker_access_1.log
  -rw-r--r-- 1 root root 309 Jan7 20:16 puppetmaster_worker_access_2.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 puppetmaster_worker_error_1.log
  -rw-r--r-- 1 root root   0 Jan7 20:14 puppetmaster_worker_error_2.log
  root@master-1:~# cat /var/log/apache2/balancer_access.log
  192.168.1.120 - - "GET /production/node/node-1.puppet.com?transaction_uuid=2d53569c-b6bf-4396-87b4-c0c341379d3c&fail_on_404=true HTTP/1.1" 200 10466 "-" "Ruby"
  192.168.1.120 - - "GET /production/file_metadatas/pluginfacts?links=manage&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 HTTP/1.1" 200 569 "-" "Ruby"
  192.168.1.120 - - "GET /production/file_metadatas/plugins?links=manage&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 HTTP/1.1" 200 569 "-" "Ruby"
  192.168.1.120 - - "POST /production/catalog/node-1.puppet.com HTTP/1.1" 200 869 "-" "Ruby"
  192.168.1.120 - - "PUT /production/report/node-1.puppet.com HTTP/1.1" 200 298 "-" "Ruby"
  root@master-1:~# cat /var/log/apache2/puppetmaster_worker_access_1.log
  127.0.0.1 - - "GET /production/node/node-1.puppet.com?transaction_uuid=2d53569c-b6bf-4396-87b4-c0c341379d3c&fail_on_404=true HTTP/1.1" 200 5122 "-" "Ruby"
  127.0.0.1 - - "POST /production/catalog/node-1.puppet.com HTTP/1.1" 200 867 "-" "Ruby"
  root@master-1:~# cat /var/log/apache2/puppetmaster_worker_access_2.log
  127.0.0.1 - - "GET /production/file_metadatas/pluginfacts?links=manage&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 HTTP/1.1" 200 567 "-" "Ruby"
  127.0.0.1 - - "PUT /production/report/node-1.puppet.com HTTP/1.1" 200 296 "-" "Ruby"
  
  # master-2 上查看 log 结果
  root@master-2:/etc/apache2/sites-enabled# ll /var/log/apache2/
  total 8
  -rw-r--r-- 1 root root   0 Jan7 20:15 access.log
  -rw-r--r-- 1 root root 155 Jan7 20:15 error.log
  -rw-r--r-- 1 root root   0 Jan7 20:15 other_vhosts_access.log
  -rw-r--r-- 1 root root 195 Jan7 20:16 puppetmaster_worker_access.log
  -rw-r--r-- 1 root root   0 Jan7 20:15 puppetmaster_worker_error.log
  root@master-2:/etc/apache2/sites-enabled# cat /var/log/apache2/puppetmaster_worker_access.log
  192.168.1.100 - - "GET /production/file_metadatas/plugins?links=manage&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 HTTP/1.1" 200 567 "-" "Ruby"
页: [1]
查看完整版本: puppet 横向扩展(二)