Puppet在同步时遇到以下错误:
notice: Run of Puppet configuration client already in progress; skipping
删除puppetdlock重试解决:
rm /var/lib/puppet/state/puppetdlock
发布时间:August 31, 2012 // 分类:Puppet // No Comments
Puppet在同步时遇到以下错误:
notice: Run of Puppet configuration client already in progress; skipping
删除puppetdlock重试解决:
rm /var/lib/puppet/state/puppetdlock
发布时间:July 3, 2012 // 分类:Puppet // No Comments
Puppet以C/S方式运行,客户端连接读取服务器端的配置并在本机执行,极大方便多服务器情况下的重复管理工作。
安装Puppet的主机要有完整的域名,可设置主机名或DNS,多服务器同步对时钟要求严格,最好安装ntp自动对时。
Puppet服务器端安装:
yum install puppet-server ntp
hostname master.www.haiyun.me
ntpdate pool.ntp.org
/etc/init.d/puppetmaster start
chkconfig puppetmaster on
Puppet客户器端安装:
yum install puppet ntp
hostname node1.www.haiyun.me
ntpdate pool.ntp.org
/etc/init.d/puppet start
chkconfig puppet on
echo "192.168.1.2 master.www.haiyun.me" >> /etc/hosts
服务器端如有开启Iptables需开启puppet端口:
iptables -A INPUT -p tcp -dport 8140 -j ACCEPT
客户端与服务器端同步SSL证书:
puppetd --server master.www.haiyun.me --test
服务器端签核证书:
puppetca --list
puppetca -s node1.www.haiyun.me
#puppetca -s -a 签核所有证书请求
可配置特定主机名自动通过认证:
echo "*.www.haiyun.me" >> /etc/puppet/autosign.conf
服务器端新建配置同步到客户端执行测试:
vim /etc/puppet/manifests/site.pp
node default {
file {
"/tmp/test.txt": content => "hello, puppet",
owner => root,
group => root,
mode => 644;
}
}
客户端同步测试:
puppetd --server master.www.haiyun.me --test
查看/tmp目录,有新建test.txt文件,权限644,用户root。
ls -a /tmp/
-rw-r--r-- 1 root root 12 07-03 16:54 test.txt
注:如果服务器端配置文件错误,客户端执行后可能会锁定进程并提示:
notice: Run of Puppet configuration client already in progress; skipping
解决:
rm /var/lib/puppet/state/puppetdlock