I've always been testing replicasets by starting multiple mongod processes on the same server (because using multiple serves is more expensive, and I'm merely testing at this point).
However, since I've updated mongo to version v2.0.5 I'm getting the following when I try to start mongod again (on another port, with another database folder, etc.):
mongod already running
Why is this so? Is there a flag to skip this check?
Update: for some reason this only happens when I run mongod like so:
sudo start-stop-daemon --start -c mainuser --exec /usr/local/bin/mongod -- --journal --nohttpinterface --dbpath /home/mainuser/data/db-secondary --logpath /home/mainuser/data/logs/mongodb-secondary.log --logappend --replSet appname --port 30001
It does not happen when I run it like so:
sudo /usr/local/bin/mongod --journal --nohttpinterface --dbpath /home/mainuser/data/db-secondary --logpath /home/mainuser/data/logs/mongodb-secondary.log --logappend --replSet appname --port 30001
Unfortunately I have to use the start-stop-daemon for use in my upstart script on Ubuntu 10.04 LTS. Why would it cause this issue?
After reading the manpage for start-stop-daemon it becomes clear that it is purposely not trying to start the process again because it recognizes it as being the same "service". However, I'm only using start-stop-daemon so that I can run as a different user with Upstart. Is it possible to bypass the check, or run as a non-sudo user in upstart in a different way?
Possible solution: You need to use start-stop-daemon's key --name to give diffeent names to different processes. For example for node.js:
start-stop-daemon --name node-charts --start --exec /usr/bin/node -- someapp.js
and
start-stop-daemon --name node-web --start --exec /usr/bin/node -- someotherapp.js
without name it will not start because of it has same /usr/bin/node process name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With