【linux系统下载_学习_教程_编程_软件】提供全系列Linux发行版下载学习-Linux部落
当前位置: 主页 > Linux系统教程 > 自动化 >

centos 系统安装 puppet dashboard

时间:2017-09-15 11:07来源:原创 作者:admin 点击:
------分隔线----------------------------
1.安装ruby1.8.7略

2.安装rake
#wget http://files.rubyforge.vm.bytemark.co.uk/rake/rake-0.8.7.tgz
#tar xf rake-0.8.7.tgz
#cd rake-0.8.7
#ruby install.rb

3.安装rubygems
#wget http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.8.11.tgz
#tar xf rubygems-1.8.11.tgz
#cd rubygems-1.8.11
#ruby setup.rb

4.安装Ruby-MySQL
#gem install mysql
如果你的mysql安装的不是默认位置,则使用以下命令:
#env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/path/to/your/mysql_config --with-mysql-dir=/path/of/mysql

5.安装dashboard
#wget http://puppetlabs.com/downloads/dashboard/puppet-dashboard-1.2.18.tar.gz
#tar xf puppet-dashboard-1.2.18.tar.gz
#mv puppet-dashboard-1.2.18 /www/puppet-dashboard
#cd /www/puppet-dashboard/config
#cp database.yml{.example,}
#cp settings.yml{.example,}

6.修改配置文件
#vim database.yml
production:
database: dashboard
username: dashboard
password: my_password
encoding: utf8
adapter: mysql

7.修改时区
#vim enviroment.rb
config.time_zone = 'Beijing'


8.修改my.cnf
#vim /etc/my.cnf
max_allowed_packet = 32M

9.创建dashboard库,及添加mysql用户


10.创建数据库表
注意当前目录仍然是/www/puppet-dashboard/config
#rake RAILS_ENV=production db:migrate

11.启动
#cd ..
#script/server -e production -d
#env RAILS_ENV=production /www/puppet-dashboard/script/delayed_job -p dashboard -n 2 -m start
#默认侦听3000端口

12.修改puppet客户端配置文件
#vim /etc/puppet/puppet.conf
[agent]
report = true
#/etc/init.d/puppet restart

13.修改puppet服务端配置文件
#vim /etc/puppet/puppet.conf
[master]
reports = store, http
reporturl = http://x.x.x.x:3000/reports/upload
#/etc/init.d/puppetmaster restart

14.导入原有日志到dashboard的数据库:
#rake RAILS_ENV=production reports:import
默认情况下,上面的命令会将/var/lib/puppet/lib(puppetmasterd –configprint libdir)目录中查找,如果报告不再这里的话,执行:
#rake RAILS_ENV=production reports:import REPORT_DIR=/path/to/your/reports


常见puppet-dashboard的rake任务
导入原有日志到dashboard的数据库:
rake RAILS_ENV=production reports:import

数据库优化:
rake RAILS_ENV=production db:raw:optimize

清理一个月前的数据:
rake RAILS_ENV=production reports:prune upto=1 unit=mon

备份数据库为sql文档:
rake RAILS_ENV=production FILE=/my/backup/file.sql db:raw:dump

从sql文档中恢复数据库:
rake RAILS_ENV=production FILE=/my/backup/file.sql db:raw:restore

本文地址:http://www.linuxzone.net/auto/210.html
------分隔线----------------------------
相关文章
栏目列表