这实验至少用了我4天,全是坑
Puppet Dasshboard是由支持Puppet开发的公司Puppetlabs创建的,是Ruby on Rails程序。可以作为一个ENC(外部节点分类器)以及一个报告工具,并且正在逐渐成为一个包含许多Puppet新功能的集成界面,例如审计和资源管 理功能。 Puppet Dashboard是一个Ruby on Rails程序,用于显示Puppet master和agent的相关信息。它允许你查看从一个或多个Puppet master汇总的图形和报告数据。它同时从一个或者多个Puppet master上收集来自于Puppet agent的资产数据(主机的Fact和其他信息)。最后,它能作为一个ENC来配置Puppet节点,并指定这些节点上的类和参数。
参考
http://docs.puppetlabs.com/guides/installing_dashboard.html
https://github.com/sodabrew/puppet-dashboard
https://forge.puppet.com/puppetlabs/dashboard
puppet module install puppetlabs-dashboard --version 0.0.4
看下怎么用
更新下节点 site。pp配置
vi /etc/puppet/manifests/site.pp
node default {
class {'dashboard':
dashboard_ensure => 'present',
dashboard_user => 'puppet-dbuser',
dashboard_group => 'puppet-dbgroup',
dashboard_password => 'changeme',
dashboard_db => 'dashboard_prod',
dashboard_charset => 'utf8',
dashboard_site => $fqdn,
dashboard_port => '8080',
mysql_root_pw => 'changemetoo',
passenger => true,
}
}
验证下site。pp配置
模块没有自带mysql ?
看一下模板帮助
puppet help dashboard
好吧,没有帮助
看一下readme
* Ensure that you have Puppet 2.7.6 or greater installed. This face MAY work on version 2.7.2 or later, but it's not been tested.
不用总行了把,容我卸载下,我靠,还不能批量卸载
还好我有快照,一切恢复出厂
手动安装
yum install -y git libmysqlclient-dev libpq-dev libsqlite3-dev ruby-dev libxml2-dev libxslt-dev nodejs
找到一个ruby开发环境包
yum install -y ruby-devel.x86_64
边下载仪表盘,边查为毛没有这些软件包
cd /usr/share && \
git clone https://github.com/sodabrew/puppet-dashboard.git && \
cd puppet-dashboard
centos没有mysql了,都是mariadb了,为了兼容性,先安装mysql
cd /usr/local/src/
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum install -y mysql-community-server.x86_64 mysql-community-client.x86_64
查了一下mariadb 库还在,用mysql 替换了,
systemctl restart mysqld
grep 'temporary password' /var/log/mysqld.log
mysql -u root -p
alter user 'root'@'localhost' identified by '12345.coM';
flush privileges;
或者直接不要密码
vim /etc/my.cnf
skip-grant-tables
创建表和用户
mysql -p -e"CREATE DATABASE dashboard_production CHARACTER SET utf8;" && \
mysql -p -e"CREATE USER 'dashboard'@'localhost' IDENTIFIED BY '12345.coM';" && \
mysql -p -e"GRANT ALL PRIVILEGES ON dashboard_production.* TO 'dashboard'@'localhost';"
mysql 更新下配置
vi /etc/mysql.my.cnf
max_allowed_packet = 32M
仪表盘库
gem install bundler && \
bundle install --deployment
出错鸟,不能以root安装
su pactera
配置数据库连接
cd /usr/share/puppet-dashboard/config
sudo cp database.yml.example database.yml
vi /usr/share/puppet-dashboard/config/database.ymlproduction:
database: dashboard_production
username: dashboard
password: 12345.coM
encoding: utf8
adapter: mysql2
出错了
rake RAILS_ENV=production db:migrate
rake RAILS_ENV=production db:migrate --trace
rake 是ruby写的,ruby我已经安装了啊
gem install -v=0.8.7 rake
难道是ruby要升级么
yum install -y centos-release-scl-rh
yum install -y rh-ruby23
scl enable rh-ruby23 bash
ruby -v
gem install rdoc
cd /usr/share/puppet-dashboard/
rake RAILS_ENV=production db:migrate
仍然出错
gem list下,rake没有安装好么
再次安装下rake
gem install -v=0.8.7 rake
还是有错误
Could not load rdoc/task. Some rake tasks may not be available without rdoc/task.
仪表盘组件先安装下
gem install bundler && \
bundle install --deployment
gem source-a https://ruby.taobao.org
居然404,后来想起来taobao源不再维护ruby了
依赖库还有依赖库的问题
gem install -v=0.8.7 rake
先睡觉了