Ask Your Question
0

mongodb not starting due to pid file issues

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

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/mongodb.pid but when mongodb-server installs, it creates mongod.pid instead. The only work around I've found is to manually ln -s mongodb.pid to mongod.pid, 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 mongodb.pid file gets specified, and still no luck -- systemctl is looking for mongodb.pid even when mongodb is installed manually and creating the mongod.pid 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
1

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

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 mongod.pid instead of mongodb.pid

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

params.pp:

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

server/service.pp:

if $service_ensure {
    mongodb_conn_validator { 'mongodb':
      server  => $bind_ip,
      port    => $port_real,
      timeout => '240',
     **** require => [File['/var/run/mongodb/mongodb.pid'],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

Stats

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

Seen: 773 times

Last updated: Mar 09 '15