Ask Your Question

mongodb not starting due to pid file issues

asked 2015-03-06 07:45:30 -0600

aaa gravatar image

Hello, In attempting to deploy openstack with puppet, I am constantly faced with the issue of multiple runs as oposed to a single client run of puppet because the mongo db pid file. I am deploying on a CentOS 7 server, and have an issue with the creation of the pid file being incorrect. I have specified in the mongodb module that it should be using /var/run/mongodb/ but when mongodb-server installs, it creates instead. The only work around I've found is to manually ln -s to, but this requires several attempts running the puppet agent, something I do not wish to do in the production environment. I have even tried creating the link from within the params.pp file where the file gets specified, and still no luck -- systemctl is looking for even when mongodb is installed manually and creating the file.

Is there a solution to this issue -- I have seen other forums suggest the changes I've already made, and I am using the 2.4.9-3 version of mongo (the downgraded version suggested by the bug description) and still have the same issue.

Any help is appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-09 15:48:54 -0600

aaa gravatar image

The fix seems to be to add a link creation into the puppet manifest file params.pp in addition to ensuring the pidfilepath has been updated in the RHEL section to be instead of

AND modifying the service.pp file to make sure this link exists before the service is started.


file {$pidfilepath:
    ensure => present,
file {'/var/run/mongodb/':
    ensure => link,
    target => $pidfilepath,
    require => File[$pidfilepath],


if $service_ensure {
    mongodb_conn_validator { 'mongodb':
      server  => $bind_ip,
      port    => $port_real,
      timeout => '240',
     **** require => [File['/var/run/mongodb/'],Service['mongodb']],
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-03-06 07:45:30 -0600

Seen: 1,580 times

Last updated: Mar 09 '15