WEB开发网
开发学院服务器服务器方案 Centos6.2_x86_64环境下puppet-dashboard安装配置... 阅读

Centos6.2_x86_64环境下puppet-dashboard安装配置

 2013-03-20 14:32:54 来源:开发学院   
核心提示: 系统环境:Centos6.2_x86_64puppet-3.0.2一、安装puppet-dashboardyum install rubygem-rake ruby-mysql mysql-server puppet-dashboard二、修改mysql配置1. 修改单行最大容量vim /etc/my.cnfmax

 系统环境:
Centos6.2_x86_64
puppet-3.0.2

一、安装puppet-dashboard

yum install rubygem-rake ruby-mysql mysql-server puppet-dashboard


二、修改mysql配置

1. 修改单行最大容量
vim /etc/my.cnf

max_allowed_packet = 32M #[mysqld]内加入

2. 配置默认字符集为utf8
defalut-character-set = utf8 #[mysqld]和[client]内加入

3. 创建mysql数据库和用户
create database dashboard;
grant all on dashboard.* to puppet@'localhost' identified by 'centos';
flush privileges;

三、配置puppet-dashboard

1. 修改database.yml
vim /usr/share/puppet-dashboard/config/database.yml

production:
database: dashboard
username: puppet
password: centos
encoding: utf8
adapter: mysql

2. 导入表结构,依次执行如下命令
cd /usr/share/puppet-dashboard
rake gems:refresh_specs
rake RAILS_ENV=production db:migrate

3. 测试puppet-dashboard能否工作
/usr/share/puppet-dashboard/script/server -e production


4. 启动完成后访问http://ip:3000测试

四、配置puppet服务端和客户端
服务器端配置
vim /etc/puppet/puppet.conf #在[main]内添加

reports = http,store
reporturl = http://IP:3000/reports/upload
修改完毕后重启puppetmaster服务



在客户端配置
vim /etc/puppet/puppet.conf #在[agent]内添加

report = true
修改完毕后重启puppet服务
五、dashboard相关命令
导入已有的报告
cd /usr/share/puppet-dashboard
rake RAILS_ENV=production reports:import
运行分析报告进程
env RAILS_ENV=production /usr/share/puppet-dashboard/script/delayed_job -p dashboard -n 4 -m start #-n 指定启动多少个进程,-m stop 停止分析进程,-m start 启动分析进程

后台运行dashboard
/usr/share/puppet-dashboard/script/server -e production -d
六、puppet-dashboard+apache配置
解决依赖关系
yum install httpd mod_passenger
配置apache
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

PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
PassengerStatThrottleRate 120
RailsAutoDetect On
</IfModule>
<VirtualHost *:8001>
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>

七、整合puppetmaster到apache
解决依赖关系
yum install mod_ssl
创建apache配置
cp /usr/share/puppet/ext/rack/files/apache2.conf /etc/httpd/conf.d/rack.conf
mkdir -p /etc/puppet/rack/public
cp /usr/share/puppet/ext/rack/files/config.ru /etc/puppet/rack/
修改apache配置
vim /etc/httpd/conf.d/rack.conf

# you probably want to tune these settings #注释这些配置,因为已经在passenger.conf中定义
#PassengerHighPerformance on
#PassengerMaxPoolSize 12
#PassengerPoolIdleTime 1500
# PassengerMaxRequests 1000
#PassengerStatThrottleRate 120
#RackAutoDetect Off
#RailsAutoDetect Off

Listen 8140

<VirtualHost *:8140>
SSLEngine on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP

SSLCertificateFile /var/lib/puppet/ssl/certs/puppet.server.cihi.cn.pem #修改这里对应的路径
SSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/puppet.server.cihi.cn.pem
SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem
SSLCACertificateFile /var/lib/puppet/ssl/ca/ca_crt.pem
SSLCARevocationFile /var/lib/puppet/ssl/ca/ca_crl.pem
SSLVerifyClient optional
SSLVerifyDepth 1

Tags:Centos 环境 puppet

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接