puppet 安装mysql_puppet学习—默认WEBRick安装DashBoard

DashBoard是puppet的控制台,用于显示puppet master和puppet agent的相关信息。本文以默认的WEBRick提供Web服务。DashBoard 安装在master.test.com。并且在客户端配置文件做如下配置

#vim /etc/puppet/puppet.conf

[agent]

report = true

一、安装依赖软件包

#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

#service puppet-dashboard start

#chkconfig puppet-dashboard on

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

4导入现有报告

#cd /usr/share/puppet-dashboard

#rake RAILS_ENV=production reports:import

5配置实时发送报告

#vim /etc/puppet/puppet.conf

reports = store,tagmail,log,puppet_dashboard,http

reporturl = http://172.16.30.220:3000/reports

6开启报告

#rake RAILS_ENV=production jobs:work 2 &>1 &

7访问dashboard

四、数据库管理

1当puppet dashboard数据量过多的时候,需要优化数据库,可使用命令:

#rake RAILS_ENV=production db:raw:optimize

2清理dashborad一个月之前的数据:

#rake RAILS_ENV=production reports:prune upto=1 unit=mon

3备份puppet dashborad数据库:

#rake RAILS_ENV=production FILE=/my/backup/file.sql db:raw:dump

4恢复数据:

#rake RAILS_ENV=production FILE=production.sql db:raw:restore

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值