- sudo yum -y install openssl-devel gcc-c++ zlib-devel readline-devel mysql mysql-server mysql-devel
- sudo wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz
- tar xvzf ruby-enterprise-1.8.7-2011.03
- ./ruby-enterprise-1.8.7-2011.03/installer
NOTE:需要耐心等待一段时间。出现选择安装路径。本人写的是/usr/local/ruby
修改系统环境
- sudo echo "#by notry 2011-11-15#" >> /etc/profile
- sudo echo "export PATH=/usr/local/ruby/bin/:$PATH" >> /etc/profile
- source /etc/profile
- wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz
- tar zxvf rubygems-1.3.6.tgz ; ruby rubygems-1.3.6/setup.rb
- gem install mysql; gem install rake
NOTE:由于网速比较.我事先下载然后手动安装 文件名字分别是
mysql-2.8.1.gem 下载地址:
http://rubygems.org/downloads/mysql-2.8.1.gem
rake-0.9.2.gem 下载地址:
http://pkgs.fedoraproject.org/repo/pkgs/rubygem-rake/rake-0.9.2.gem/53e95232c3ba141e8cb10e2540af09eb/rake-0.9.2.gem
- wget http://puppetlabs.com/downloads/dashboard/puppet-dashboard-1.2.2.tar.gz
安装Puppet dashboard
- groupadd puppet
- useradd -g puppet puppet #创建puppet用户
- tar xzvf puppet-dashboard-1.2.2.tar.gz
- mv puppet-dashboard-1.2.2 /usr/local/puppet-dashboard
- sudo chown -R puppet:puppet /usr/local/puppet-dashboard -R
创建mysql数据库
- mysql>create database dashboard character set utf8;
- mysql>grant all privileges on dashboard.* to dashboard@'localhost' identified by 'dashboard';
- mysql>flush privileges;
配置puppet dashboard
- cd /usr/local/puppet-dashboard
- cp config/database.yml.example config/database.yml
- cp config/settings.yml.example config/settings.yml
- [notry@master config ]$vim database.yml
- production:
- database: dashboard
- username: dashboard
- password: dashboard
- encoding: utf8
- adapter: mysql
导入mysql
- [notry@master puppet-dashboard]$rake RAILS_ENV=production db:migrate
启动puppet dashboard
- [notry@master puppet-dashboard]$sudo -u puppet ./script/server -e production
NOTE:现在一般浏览器上输入:master.xxxx.com:3000会出现图形界面
Puppet client配置
- #puppet.conf (on each agent)
- [agent]
- report = true
-
- sudo /etc/init.d/puppet restart
Puppet Server配置
- #puppet.conf (on puppet server)
- [main]
- reports = store, http
-
- sudo /etc/init.d/puppetmaster restart
NOTE:Puppet clients的puppetd --server master.ihaveu.com --test 都会在网页上有小标识出现。
识别
- [notry@master puppet-dashboard]$env RAILS_ENV=production script/delayed_job -p dashboard -n 4 -m start
-