Puppet Dashboard是由支持Puppet開發的公司Puppetlabs建立的,是Ruby on Rails程序。能夠做爲一個ENC(外部節點分類器)以及一個報告工具,而且正在逐漸成爲一個包含許多Puppet新功能的集成界面,例如審計和資源管理功能。 Puppet Dashboard是一個Ruby on Rails程序,用於顯示Puppet master和agent的相關信息。它容許你查看從一個或多個Puppet master彙總的圖形和報告數據。它同時從一個或者多個Puppet master上收集來自於Puppet agent的資產數據(主機的Fact和其餘信息)。最後,它能做爲一個ENC來配置Puppet節點,並指定這些節點上的類和參數。mysql
puppet dashboard的配置:nginx
在master端c++
安裝所需的軟件包web
yum install puppet-dashboard-1.2.23-1.el6.noarch.rpm mysql-server rubygem-rake-0.8.7-2.1.el6.noarch.rpm ruby-mysql-2.8.2-1.el6.x86_64.rpm -y
配置mysql數據庫:sql
/etc/init.d/mysqld start mysql> CREATE DATABASE dashboard_production CHARACTER SET utf8; mysql> CREATE USER 'dashboard'@'localhost' IDENTIFIED BY 'westos'; mysql> GRANT ALL PRIVILEGES ON dashboard_production.* TO 'dashboard'@'localhost'; vim /usr/share/puppet-dashboard/config/database.yml #這裏只使用了生產環境配置 production: database: dashboard_production username: dashboard password: westos encoding: utf8 adapter: mysql cd /usr/share/puppet-dashboard/config rake RAILS_ENV=production db:migrate #創建 dashboard 所需的數據庫和表
修改puppet-dashboard的時區數據庫
vim /usr/share/puppet-dashboard/config/settings.yml time_zone: 'Beijing'
使用下面這個指令能夠查看可用的時區vim
rake time:zones:local
/etc/init.d/puppet-dashboard start
chmod 666 /usr/share/puppet-dashboard/log/production.log /etc/init.d/puppet-dashboard-workers start
設置報告彙總ruby
vim /etc/puppet/puppet.conf [main] reports = http reporturl=http://172.25.254.1:3000/reports /etc/puppetmaster reload
登陸http://172.25.9.1:3000進入到檢測頁面session
此時尚未報告生成咱們須要在client端打開報告同步以此數據就能夠看到信息了curl
vim /etc/puppet/puppet.conf [agent] report =true puppet agent --server=server1.example.com --no-daemonize -vt #進行手動同步puppet未在後臺運行的狀況下
以後再次刷新網站就能看到報告了
點擊節點就能看到具體的日誌信息了
client端自動同步的狀況下要在client端進行如下操做:
vim /etc/sysconfig/puppet PUPPET_SERVER=puppet.example.com #puppet master 的地址 PUPPET_PORT=8140 #puppet 監聽端口 PUPPET_LOG=/var/log/puppet/puppet.log #puppet 本地日誌#PUPPET_EXTRA_OPTS=--waitforcert=500 #默認同步的時間這裏沒有打開而是在下面的文件配置的
修改默認同步的時間
vim /etc/puppet/puppet.conf [agent] runinterval =300 #單位爲秒 /etc/init.d/puppet start
nginx+passenger:
puppet 默認使用基於 Ruby 的 WEBRickHTTP 來處理 HTTPS 請求,可是這些語言的內置webserver目的僅是爲了方便調試代碼,自己的性能十分的差,而使用常見的Web Server軟件就能夠顯著的提升單臺的puppetmaster的性能。這裏就是使用的是Nginx去提升puppetmaster的性能
安裝所需的依賴性:
yum install -y gcc gcc-c++ curl-devel zlib-devel openssl-devel ruby-devel pcre-devel gem install passenger-5.0.15.gem rack-1.6.4.gem #沒有聯網的狀況下須要gem包,聯網的狀況下直接 gem install rack passenger passenger-install-nginx-module #腳本會自動安裝 nginx 支持,按提示操做
安裝好後更改nginx的配置
vim /opt/nginx/conf/nginx.conf server { listen 8140; server_name server1.example.com; root /etc/puppet/rack/public; passenger_enabled on; passenger_set_header X_CLIENT_DN $ssl_client_s_dn; passenger_set_header X_CLIENT_VERIFY $ssl_client_verify; ssl on; ssl_session_timeout 5m; ssl_certificate /var/lib/puppet/ssl/certs/server1.example.com.pem; ssl_certificate_key /var/lib/puppet/ssl/private_keys/server1.example.com.pem; ssl_client_certificate /var/lib/puppet/ssl/ca/ca_crt.pem; ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem; ssl_verify_client optional; ssl_ciphers SSLv2:-LOW:-EXPORT:RC4+RSA; ssl_prefer_server_ciphers on; ssl_verify_depth 1; ssl_session_cache shared:SSL:128m; } mkdir /etc/puppet/rack/{public,tmp} -p cp /usr/share/puppet/ext/rack/config.ru /etc/puppet/rack/ chown puppet.puppet -R /etc/puppet/rack/ /etc/init.d/puppetmaster stop #puppetmaster不須要再啓動了,nginx啓動後會自動調用puppetmaster /opt/nginx/sbin/nginx -t #檢測 nginx /opt/nginx/sbin/nginx
監測:在client端能夠進行同步就證實成功了。