I am setting up an arbiter onto the same machine as a config server, but having some trouble with the default 10gen /etc/init.d/mongod
file.
I tried creating an additional /etc/init.d/mongod-arb
for the arbiter pointing to a new .conf
file, but it seems to ignore the pidfilepath in the conf file and I can only get one mongod to run at any one time...
Is there some best practices for such a configuration?
There are several open issues related to the init scripts at the moment, for example check out these:
https://jira.mongodb.org/browse/SERVER-9275 https://jira.mongodb.org/browse/SERVER-9253 https://jira.mongodb.org/browse/SERVER-3748 (most relevant here)
Having dug through this stuff in the past, there are issues with how killproc is being called and how it figures out what the PID should be, so even when you get them both running, you end up shutting them both down whenever you stop either.
Last time I hit this, I just re-created the binaries elsewhere for the config server to avoid the whole mess and keep everything completely separate. However it should be possible to run both with a smart enough init script.
There is a decent first attempt at a separate config server init script as part of a pull request here which may help you if you decide to go that route:
https://github.com/ClarityServices/mongo/blob/d45a824cedba957808c89f40282a8c18bb44e298/rpm/init.d-mongoc