Puppet自动化运维排错案例

近日,自己维护的一组Puppet Agent机器,出现了如下报错:

notice: Run of Puppet configuration client already in progress; skipping

解决方法:

之前用网上的方法,删除puppet.lock文件,命令如下:

rm /var/lib/puppet/state/puppet.lock

发现故障依旧;后来发现出现此现象是由于/etc/puppet/manifests/site.pp配置文件没有写正确,我们将其改正就行了,其实以后像puppet server里面的site.pp和init.pp有比较大的改动时,最好先用puppet parser validate命令先检查,示例如下:

[root@server manifests]# puppet parser validate site.pp

err: Could not parse for environment production: Syntax error at 'source'; expected '}' at

/etc/puppet/manifests/site.pp:8

err: Try 'puppet help parser validate' for usage

如上所示,很明显提标示site.pp第8行有错误,提示我们改正,改正以后故障排除,事实上puppet parser validate命令用于puppet server语法非常有用,示例如下:

puppet parser validate node.pp

node.pp本身语法就存在错误,第10行缺少}号,报错信息如下:

err: Could not parse for environment production: Syntax error at end of file; expected '}' at /etc/puppet/manifests/node.pp:10

err: Try 'puppet help parser validate' for usage

Puppet 学习系列:

相关阅读:

Puppet 的详细介绍:请点这里
Puppet 的下载地址:请点这里

相关推荐