Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to install MongoDB on Ubuntu 10.04.

I followed these installation instructions. I got the following error:

Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91

What do I need to do to fix this?

Here is the log output:

**** SERVER RESTARTED *****

> Sun Sep 23 22:36:20 
Sun Sep 23 22:36:20 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Sun Sep 23 22:36:20 
Sun Sep 23 22:36:20 [initandlisten] MongoDB starting : pid=1916 port=27017 dbpath=/var/lib/mongodb 32-bit host=bruce-ubuntu1004
Sun Sep 23 22:36:20 [initandlisten] 
Sun Sep 23 22:36:20 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Sun Sep 23 22:36:20 [initandlisten] **       see (http://)blog.mongodb.org/post/137788967/32-bit-limitations
Sun Sep 23 22:36:20 [initandlisten] **       with --journal, the limit is lower
Sun Sep 23 22:36:20 [initandlisten] 
Sun Sep 23 22:36:20 [initandlisten] db version v2.2.0, pdfile version 4.5
Sun Sep 23 22:36:20 [initandlisten] git version: f5e83eae9cfbec7fb7a071321928f00d1b0c5207
Sun Sep 23 22:36:20 [initandlisten] build info: Linux domU-12-31-39-01-70-B4 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_49
Sun Sep 23 22:36:20 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log" }
Sun Sep 23 22:36:20 [initandlisten] Unable to check for journal files due to: boost::filesystem::basic_directory_iterator constructor: No such file or directory: "/var/lib/mongodb/journal"
************** 
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
Sun Sep 23 22:36:20 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Sun Sep 23 22:36:20 dbexit: 
Sun Sep 23 22:36:20 [initandlisten] shutdown: going to close listening sockets...
Sun Sep 23 22:36:20 [initandlisten] shutdown: going to flush diaglog...
Sun Sep 23 22:36:20 [initandlisten] shutdown: going to close sockets...
Sun Sep 23 22:36:20 [initandlisten] shutdown: waiting for fs preallocator...
Sun Sep 23 22:36:20 [initandlisten] shutdown: closing all files...
Sun Sep 23 22:36:20 [initandlisten] closeAllFiles() finished
Sun Sep 23 22:36:20 dbexit: really exiting now
share|improve this question

1 Answer 1

up vote 4 down vote accepted

You probably just need to delete the lock file in /var/lib/mongodb, and then restart the service.

If you still have problems, you should run mongod --repair (along with the other options, at least the dbpath).

share|improve this answer
    
Thank you...that seemed to do the trick...it's odd I installed it on the same version Ubuntu on desktop and laptop but only the laptop gave me trouble.....You saved me, so thanks again! –  Nona Sep 24 '12 at 4:48

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.