最新消息:

Puppet错误收集

error admin 3051浏览 0评论
1.private method `split’
[root@localhost]# puppetd –test –server master.yaukb.com
info: Caching catalog for web.yaukb.com
err: Could not run Puppet configuration client: private method `split’ called for #<Array:0x2b6f827b5ee0>

 

因写exec资源是command使用了多个造成。
command => [“/etc/init.d/resin start”,”sh test.sh”]
这样写是不行的。
2.使用sudo方式,在建立证书时要使用root用户创建
不然会出现下面的错误:没有权限
$ puppetd –test –server puppet.yaukb.com
info: Caching catalog for nengtong-tj-mysql-web164.bw.mg
info: Applying configuration version ’1338955935′
err: /Stage[main]/Rm_history_command/File[/data/tools/rm_command_history.sh]/ensure: change from absent to file failed: Could not set ‘file on ensure: Permission denied – /data/tools/rm_command_history.sh.puppettmp_8491 at /etc/puppet/modules/rm_history_command/manifests/init.pp:7
notice: /Stage[main]/Rm_history_command/Exec[/bin/sh /data/tools/rm_command_history.sh]: Dependency File[/data/tools/rm_command_history.sh] has failures: true
warning: /Stage[main]/Rm_history_command/Exec[/bin/sh /data/tools/rm_command_history.sh]: Skipping because of failed dependencies
notice: Finished catalog run in 0.41 seconds
解决方法:
On the master:
  puppet cert clean nengtong-tj-mysql-web164.bw.mg
On the agent:
  rm -f /etc/puppet/ssl/certs/nengtong-tj-mysql-web164.bw.mg.pem
  puppet agent -t
切换到root用户
#su root
[root@nengtong-tj-mysql-web164 qiuyuxian]# puppet agent -t
warning: peer certificate won’t be verified in this SSL session
warning: peer certificate won’t be verified in this SSL session
info: Creating a new SSL certificate request for nengtong-tj-mysql-web164.bw.mg
info: Certificate Request fingerprint (md5): 85:9A:48:8F:F3:04:BB:DB:58:66:22:52:A0:A5:BA:70
warning: peer certificate won’t be verified in this SSL session
warning: peer certificate won’t be verified in this SSL session
info: Caching certificate for nengtong-tj-mysql-web164.bw.mg
notice: Ignoring –listen on onetime run
info: Caching certificate_revocation_list for ca
info: Caching catalog for nengtong-tj-mysql-web164.bw.mg
info: Applying configuration version ’1338955935′
notice: /Stage[main]/Rm_history_command/File[/data/tools/rm_command_history.sh]/ensure: defined content as ‘{md5}829719d12e506b18564cbc55d7384560′
notice: /Stage[main]/Rm_history_command/Exec[/bin/sh /data/tools/rm_command_history.sh]/returns: executed successfully
notice: Finished catalog run in 1.04 seconds
3. 检查puppet的目录权限
客户端执行出错信息:
:puppetclient:root > puppetd –test –server puppetsvr.webex.com
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Permission denied – /etc/puppet/manifests/site.pp on node puppetclient.webex.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
服务端site.pp文件内容:
node default{
file{
“/tmp/test.txt”:content => “hello,test!”;
}
}
检查/etc/puppet/manifests/site.pp文件权限:
:puppetsvr:root > ll /etc/puppet/manifests/site.pp
-rw——- 1 root root 66 Jun 29 05:53 /etc/puppet/manifests/site.pp
可以看出是文件权限问题,解决:
#chmod 755 -R /etc/puppet
客户端再次同步OK:
:puppetclient:root > puppetd –test –server puppetsvr.webex.com
info: Caching catalog for puppetclient.webex.com
info: Applying configuration version ’1340949935′
notice: /Stage[main]//Node[test]/File[/tmp/test.txt]/ensure: defined content as ‘{md5}18ea2a60db7763506261f87ecb82fb96′
notice: Finished catalog run in 0.02 seconds
4.时间不同步问题
在使用Puppet时,一定要保证服务器端和客户端之间时间是同步的,至少不要相差太大,不然进行证书申请时会出现错误。

转载请注明:爱开源 » Puppet错误收集

您必须 登录 才能发表评论!