Sunday, 25 October 2015

mongodb service is not starting up

Answer helped me:
http://stackoverflow.com/questions/17527606/mongodb-failing-on-debian
if you don't find any traces in the logs:
tail -f -n50 /var/log/mongodb/mongodb.log
you should try to start the server in foreground:
sudo -u mongodb mongod --dbpath /var/lib/mongodb/
and see what's happening. For instance, I had a locale problem:

root@server :~# sudo -u mongodb mongod --dbpath /var/lib/mongodb/
2015-10-25T09:45:23.613+0000 E NETWORK  [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2015-10-25T09:45:23.613+0000 E NETWORK  [initandlisten]   addr already in use
2015-10-25T09:45:23.613+0000 W -        [initandlisten] Detected unclean shutdown - /var/lib/mongodb/mongod.lock is not empty.
2015-10-25T09:45:23.614+0000 I STORAGE  [initandlisten] exception in initAndListen: 98 Unable to lock file: /var/lib/mongodb/mongod.lock errno:11 Resource temporarily unavailable. Is a mongod instance already running?, terminating
2015-10-25T09:45:23.614+0000 I CONTROL  [initandlisten] dbexit:  rc: 100
To see config problem:

root@server :~# sudo -u mongodb mongod --dbpath /var/lib/mongodb/ -f /etc/mongod.conf
Unrecognized option: net.authorization
try 'mongod --help' for more information