天天看點

puppet手動注冊故障排查思路

這兩天在學習puppet,centos6.5下載下傳了puppet3.8.7版本,但手動注冊的時候各種報錯:

Exiting; failed to retrieve certificate and waitforcert is disabled

關于puppet找到一篇寫的很好的文章:

https://blog.51cto.com/superleedo/1900417

遇到puppet agent --test出現告警的時候,建議逐漸排查:

1.檢查防火牆,selinux;ping域名是否正常;/etc/resolv.conf需要注釋或删除search部分;

2.檢查用戶端的puppet.conf檔案,[main]區域要有server = puppetmaster,puppetmaster為server主機名。

在server端使用 puppet cert --clean ****删除特定證書,在用戶端清空/var/lib/puppet/ssl下的檔案。然後重新生成證書。使用puppet cert --list  --all  server端檢視證書。

3.注意/etc/puppet/manifests/site.pp,node後面的用戶端主機名需要加單引号,不然也會引起告警:

node 'puppetclient' {
file { 'helloworld':
    path => '/etc/helloworld.txt',
    owner => 'root',
    group => 'root',
    mode => '655',
    content => "hello world from puppet!\n",
    }
}
           

執行成功的結果:

[[email protected] puppet]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for puppetclient
Info: Applying configuration version '1551159635'
Notice: /Stage[main]/Main/Node[puppetclient]/File[helloworld]/ensure: defined content as '{md5}c3aa68786c58c94ef6f3e2399920f268'
Notice: Finished catalog run in 0.03 seconds
           

繼續閱讀