master:
vi /etc/hosts
末尾添加一条记录
192.168.239.130 ns2.centos.com
测试主机名是否Ping通
ping ns2.centos.com
安装和启用 puppet 服务:
yum install puppet-server
chkconfig puppet on
service puppetmasterstart client:
vi /etc/hosts
末尾添加一条记录
192.168.239.128 ns1.centos.com
测试主机名是否Ping通
ping ns1.centos.com
安装puppet客户端
yum install puppet
chkconfig puppet on
service puppet start
3.配置puppet
对于puppet 客户端,修改配置文件,指定master服务器
vi/etc/puppet/puppet.conf
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl
[agent]
# The file in which puppetd stores a listof the classes
# associated with the retrievedconfiguratiion. Can be loaded in
# the separate ``puppet`` executable usingthe ``--loadclasses``
# option.
# The default value is'$confdir/classes.txt'.
classfile = $vardir/classes.txt
# Where puppetd caches the localconfiguration. An
# extension indicating the cache format isadded automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
server =ns1.centos.com
并重启puppet服务
mysql -uroot -p123456<<EOF
CREATE DATABASEdashboard CHARACTER SET utf8;
CREATE USER'dashboard'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGESON dashboard.* TO 'dashboard'@'localhost';
FLUSH PRIVILEGES;
EOF
PassengerRoot/usr/share/rubygems/gems/passenger-3.0.17
PassengerRuby/usr/bin/ruby
PassengerHighPerformanceon
PassengerMaxPoolSize12
PassengerPoolIdleTime1500
PassengerStatThrottleRate120
RailsAutoDetect On
ServerNamens1.centos.com
DocumentRoot"/usr/share/puppet-dashboard/public/"
<Directory"/usr/share/puppet-dashboard/public/>;
Options None
AllowOverrideAuthConfig
Order allow,deny
allow from all
</Directory>
ErrorLog/var/log/httpd/ns1.centos.com_error.log
LogLevel warn
CustomLog/var/log/httpd/ns1.centos.com_access.log combined
ServerSignature On
EOF
启动服务
/etc/init.d/httpdstart
chkconfig httpd on
配置puppet
让Dashboard使用Reports,现在默认agent是已经启用Report的功能,所以你就不需要设置agent,你只需要设置Server端就可以