首页 > Web开发 > 详细

puppet学习—默认WEBRick安装DashBoard

时间:2014-08-18 18:52:03      阅读:374      评论:0      收藏:0      [点我收藏+]

  DashBoard是puppet的控制台,用于显示puppet master和puppet agent的相关信息。本文以默认的WEBRick提供Web服务。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

    #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

    http://172.16.30.220:3000/reports

四、数据库管理

    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

    

    

本文出自 “不莱梅乐队” 博客,谢绝转载!

puppet学习—默认WEBRick安装DashBoard,布布扣,bubuko.com

puppet学习—默认WEBRick安装DashBoard

原文:http://danhanwen.blog.51cto.com/8525423/1541640

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!