Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've just installed MongoDB on a fresh Ubuntu 10.10 installation, but I'm having trouble getting it to start (at all). I'm using the latest mongo-stable package via. http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages.

I would expect it to start automatically on boot, however trying to start it manually always gives me the following:

$ sudo start mongodb
mongodb start/running, process 2565
$ sudo status mongodb
mongodb stop/waiting

ps -aux doesn't show anything mongo related. Trying to run the shell gives me:

MongoDB shell version: 1.6.3
connecting to: test
Tue Oct 12 22:33:14 Error: couldn't connect to server 127.0.0.1 (anon):1137
exception: connect failed

both /var/log/mongodb and /var/lib/mongodb exist and were presumably created by the installer. Both are owned by the mongodb user (again setup by the installer), but both are empty, so there's no mongo log file for me to check, or .lock file for me to remove.

In case it's permissions related, both are

drwxr-xr-x  2 mongodb       mongodb       4096 2010-10-12 22:08 mongodb

There are no related log entries in /var/log/messages or syslog. I've tried reinstalling the package, just in case, but no difference. The version I'm running is listed as 20100930.

It's probably something simple, but I'm out of ideas, and with no errors or feedback whatsoever it's hard to know where the problem might lie. Any help appreciated.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

If you haven't done so, create a data directory as described at http://www.mongodb.org/display/DOCS/Quickstart+Unix

Check the contents of /etc/mongodb.conf

I would try running the mongodb executable directly and pass it command line options

  • -v -v -v
  • --logpath /tmp/mongotest

and anything else that seems useful from http://www.mongodb.org/display/DOCS/Command+Line+Parameters

share|improve this answer
    
The data directory had been created by the installer. When I ran the mongodb executable directly everything worked perfectly, which basically ruled out any issues with MongoDB. A bit of Googling later and I've fixed a problem with Upstart, and now Mongo is starting on boot. Many thanks. –  Tim Fountain Oct 12 '10 at 23:52
    
Tim, would you mind sharing how you got Mongo to start during boot on Ubuntu? –  drdee Nov 27 '10 at 0:45
    
Hi! I would also like to know. Thanks! –  Industrial Aug 4 '11 at 11:26
add comment

check if there's any mongo.lock file in /var/lib/mongo/ dir or your MONGOLIBDIR setting and remove it.

You should then be able to start the mongodb service.

share|improve this answer
1  
+1 - Fixed it for me. –  Taylor Leese Feb 20 '11 at 9:16
    
fixed for me too. could you elaborate on the problem that this fix is applied to? –  tm_lv Mar 17 '11 at 13:03
    
deleting the mongod.lock worked for me –  highBandWidth Jun 23 '11 at 0:36
    
+1 - fixed my problem , just deleted mongod.lock file from /var/lib/mongodb/ directory –  AbdullahDiaa Feb 3 '13 at 14:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.