DashBoard启动默认使用WEBRcik服务器,WEBRcik服务器有助于快速运行DashBoard服务器,但性能无法进行扩展,当有大量的报告时,性能会急剧下降。这时可以使用Passenger服务器运行DashBoard。DashBoard 安装在master.test.com。并且在客户端配置文件做如下配置
#vim /etc/puppet/puppet.conf
[agent]
report = true
一、安装依赖软件包
#rpm -ivh http://yum.puppetlabs.com/el/6Server/products/x86_64/puppetlabs-release-6-6.noarch.rpm
#yum -y install mysql mysql-devel mysql-server ruby ruby-devel ruby-irb ruby-mysql ruby-rdoc ruby-ri rubygems
#gem install rake
二、安装DashBoard软件包
#yum install -y puppet-dashboard
三、配置DashBoard
1创建数据库
#vim /etc/my.cnf
max_allowed_packet = 32M
#service mysqld start
#chkconfig mysqld on
#mysql
mysql>create database dashboard CHARACTER SET utf8;
mysql>create user 'dashboard'@'localhost' IDENTIFIED BY 'dashboard';
mysql>grant all privileges on dashboard.* TO 'dashboard'@'localhost';
mysql>flush privileges;
2修改配置文件
#vim /usr/share/puppet-dashboard/config/database.yml
production:
database: dashboard
username: dashboard
password: dashboard
encoding: utf8
adapter: mysql
#vim /usr/share/puppet-dashboard/config/settings.yml
time_zone: 'Asia/Shanghai'
3导入数据库
#cd /usr/share/puppet-dashboard/config
#rake RAILS_ENV=production db:migrate
四、配置httpd passenger
#yum install httpd mod_passenger
#vim /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module modules/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/share/rubygems/gems/passenger-3.0.17
PassengerRuby /usr/bin/ruby
PassengerMaxPoolSize 6 #passenger启动的线程数,通常为cpu核心个数的1.5倍
PassengerPoolIdleTime 40000 #passenger接受的最大请求数
PassengerStatThrottleRate 120 #关闭空闲超过1800秒的passenger实例
RailsAutoDetect On
</IfModule>
<VirtualHost *:80>
ServerName master.test.com
DocumentRoot "/usr/share/puppet-dashboard/public/"
<Directory "/usr/share/puppet-dashboard/public/">
Options None
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/dashboard_error.log
LogLevel warn
CustomLog /var/log/httpd/dashboard_access.log combined
ServerSignature On
</VirtualHost>
#service httpd start
#chkconfig httpd on
五、导入现有报告
#cd /usr/share/puppet-dashboard
#rake RAILS_ENV=production reports:import
六、配置实时发送报告
#vim /etc/puppet/puppet.conf
reports = store,tagmail,log,puppet_dashboard,http
reporturl = http://172.16.30.220/reports
七、开启报告
#rake RAILS_ENV=production jobs:work 2 &>1 &
八、访问dashboard
http://172.16.30.220/reports
本文出自 “不莱梅乐队” 博客,谢绝转载!