使用命令生成puppet.conf无法启动puppet master问题解决

来源:互联网 发布:win8.1 windows组件 编辑:程序博客网 时间:2024/06/08 12:38

最近对puppet比较感兴趣,然后就在虚拟机上装了puppet。一台当server,一台当agent。因为默认的puppet默认配置文件只有main和agent两个选项,并没有master。所以我使用了命令puppet –genmaster > /etc/puppet/puppet.conf,之后使用init.d下的脚本启动puppet master就起不来了。。。具体如下:

一、 环境:
1. 系统: CentOS 6.5
2. puppet版本:puppet-server-2.7.26-2.el6.noarch puppet-2.7.26-2.el6.noarch

二、问题现象:
使用/etc/init.d/puppetmasterd start启动时,在命令行会出现如下的错误:
Starting puppetmaster: /usr/lib/ruby/site_ruby/1.8/puppet/util/pidlock.rb:39:in initialize': Permission denied - /var/lib/puppet/run/master.pid (Errno::EACCES)
from /usr/lib/ruby/site_ruby/1.8/puppet/util/pidlock.rb:39:in
open’
from /usr/lib/ruby/site_ruby/1.8/puppet/util/pidlock.rb:39:in lock'
from /usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:46:in
create_pidfile’
from /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:44:in synchronize_on'
from /usr/lib/ruby/1.8/sync.rb:230:in
synchronize’
from /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:44:in synchronize_on'
from /usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:45:in
create_pidfile’
from /usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:21:in daemonize'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:193:in
main’
from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:146:in run_command'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in
run’
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:416:in hook'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in
run’
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:407:in exit_on_fail'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in
run’
from /usr/sbin/puppetmasterd:4

三、解决方法:
因为使用puppetmasterd –genconfig命令生成的puppet.conf当中,rundir为/var/lib/puppet/run,将其改为
rundir =/var/lib/puppet/run
即可。
(PS: pidfile改为$rundir/master.pid)

0 0
原创粉丝点击