Mongodb – Cannot restart mongodb on Ubuntu 11.04


I have installed mongodb and when i typing the following command i am getting these messages

root@amila:~# service mongodb status    
mongodb stop/waiting
root@amila:~# service mongodb restart    
restart: Unknown instance:     
root@amila:~# service mongodb stop    
stop: Unknown instance: 

I want to restart mongodb.but unable to restart.

here is the /etc/mongodb.conf



bind_ip =
auth = true

Best Solution

Given the output of the start command, this is starting correctly. When you are running status, it seems to have been stopped. You need to look into the log file:


That will tell you why the mongod is stopping. There are a couple of likely causes, but without seeing that output it will be hard to answer definitively. My general recommendations:

  1. Do not use bind_ip - it is a bad idea in general Update (2016): Removing this because the issues with bind_ip that caused me to write this back in 2012 have been fixed, and it is even on by default in official packages now. Worth trying without the setting as a troubleshooting step, but not a bad idea to use it in general.
  2. Check for something else running on port 27017
  3. Specify the port explicitly in the mongodb.conf file, even if you want to use the default

Finally, take a look at this answer for how to fix file permissions, just in case that is a problem (usually caused by running as root at some point):

mongodb crashes after unexpected shutdown

Related Question