Errors trying to run MongoDB
- by SomeKittens
I'm running Ubuntu Server 12.04 (32 bit) on an old (1998) computer. Everything's working fine until I try and start MongoDB.
somekittens@DLserver01:~$ mongo
MongoDB shell version: 2.2.2
connecting to: test
Sun Dec 16 22:47:50 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed
Googling the error lead me to all sorts of "repair" options, none of which fixed anything. I've also removed MongoDB and installed it again (using apt-get, have not built from source).
Mongo's log shows the following error:
Thu Dec 13 18:36:32 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Thu Dec 13 18:36:32
Thu Dec 13 18:36:32 [initandlisten] MongoDB starting : pid=758 port=27017 dbpath=/var/lib/mongodb 32-bit host=DLserver01
Thu Dec 13 18:36:32 [initandlisten]
Thu Dec 13 18:36:32 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Thu Dec 13 18:36:32 [initandlisten] ** see http://blog.mongodb.org/post/137788967/32-bit-limitations
Thu Dec 13 18:36:32 [initandlisten] ** with --journal, the limit is lower
Thu Dec 13 18:36:32 [initandlisten]
Thu Dec 13 18:36:32 [initandlisten] db version v2.2.2, pdfile version 4.5
Thu Dec 13 18:36:32 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
Thu Dec 13 18:36:32 [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
Thu Dec 13 18:36:32 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log" }
Thu Dec 13 18:36:32 [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.
*************
Thu Dec 13 18:36:32 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Thu Dec 13 18:36:32 dbexit:
Thu Dec 13 18:36:32 [initandlisten] shutdown: going to close listening sockets...
Thu Dec 13 18:36:32 [initandlisten] shutdown: going to flush diaglog...
Thu Dec 13 18:36:32 [initandlisten] shutdown: going to close sockets...
Thu Dec 13 18:36:32 [initandlisten] shutdown: waiting for fs preallocator...
Thu Dec 13 18:36:32 [initandlisten] shutdown: closing all files...
Thu Dec 13 18:36:32 [initandlisten] closeAllFiles() finished
Thu Dec 13 18:36:32 dbexit: really exiting now
Running through the recovery instructions lead to the following adventure:
somekittens@DLserver01:/var/log/mongodb$ mongod --repair
Sun Dec 16 22:42:54
Sun Dec 16 22:42:54 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Sun Dec 16 22:42:54
Sun Dec 16 22:42:54 [initandlisten] MongoDB starting : pid=1887 port=27017 dbpath=/data/db/ 32-bit host=DLserver01
Sun Dec 16 22:42:54 [initandlisten]
Sun Dec 16 22:42:54 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Sun Dec 16 22:42:54 [initandlisten] ** see http://blog.mongodb.org/post/137788967/32-bit-limitations
Sun Dec 16 22:42:54 [initandlisten] ** with --journal, the limit is lower
Sun Dec 16 22:42:54 [initandlisten]
Sun Dec 16 22:42:54 [initandlisten] db version v2.2.2, pdfile version 4.5
Sun Dec 16 22:42:54 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
Sun Dec 16 22:42:54 [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 Dec 16 22:42:54 [initandlisten] options: { repair: true }
Sun Dec 16 22:42:54 [initandlisten] exception in initAndListen: 10296
*********************************************************************
ERROR: dbpath (/data/db/) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
Sun Dec 16 22:42:54 dbexit:
Sun Dec 16 22:42:54 [initandlisten] shutdown: going to close listening sockets...
Sun Dec 16 22:42:54 [initandlisten] shutdown: going to flush diaglog...
Sun Dec 16 22:42:54 [initandlisten] shutdown: going to close sockets...
Sun Dec 16 22:42:54 [initandlisten] shutdown: waiting for fs preallocator...
Sun Dec 16 22:42:54 [initandlisten] shutdown: closing all files...
Sun Dec 16 22:42:54 [initandlisten] closeAllFiles() finished
Sun Dec 16 22:42:54 dbexit: really exiting now
somekittens@DLserver01:/var/log/mongodb$ sudo mkdir /data
somekittens@DLserver01:/var/log/mongodb$ sudo mkdir /data/db
somekittens@DLserver01:/var/log/mongodb$ mongod --repair
Sun Dec 16 22:43:51
Sun Dec 16 22:43:51 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Sun Dec 16 22:43:51
Sun Dec 16 22:43:51 [initandlisten] MongoDB starting : pid=1909 port=27017 dbpath=/data/db/ 32-bit host=DLserver01
Sun Dec 16 22:43:51 [initandlisten]
Sun Dec 16 22:43:51 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Sun Dec 16 22:43:51 [initandlisten] ** see http://blog.mongodb.org/post/137788967/32-bit-limitations
Sun Dec 16 22:43:51 [initandlisten] ** with --journal, the limit is lower
Sun Dec 16 22:43:51 [initandlisten]
Sun Dec 16 22:43:51 [initandlisten] db version v2.2.2, pdfile version 4.5
Sun Dec 16 22:43:51 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
Sun Dec 16 22:43:51 [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 Dec 16 22:43:51 [initandlisten] options: { repair: true }
Sun Dec 16 22:43:51 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Sun Dec 16 22:43:51 dbexit:
Sun Dec 16 22:43:51 [initandlisten] shutdown: going to close listening sockets...
Sun Dec 16 22:43:51 [initandlisten] shutdown: going to flush diaglog...
Sun Dec 16 22:43:51 [initandlisten] shutdown: going to close sockets...
Sun Dec 16 22:43:51 [initandlisten] shutdown: waiting for fs preallocator...
Sun Dec 16 22:43:51 [initandlisten] shutdown: closing all files...
Sun Dec 16 22:43:51 [initandlisten] closeAllFiles() finished
Sun Dec 16 22:43:51 [initandlisten] shutdown: removing fs lock...
Sun Dec 16 22:43:51 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
Sun Dec 16 22:43:51 dbexit: really exiting now
somekittens@DLserver01:/var/log/mongodb$ service mongodb stop
stop: Unknown instance:
somekittens@DLserver01:/var/log/mongodb$ sudo mongod --repair
Sun Dec 16 22:45:04
Sun Dec 16 22:45:04 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Sun Dec 16 22:45:04
Sun Dec 16 22:45:04 [initandlisten] MongoDB starting : pid=1921 port=27017 dbpath=/data/db/ 32-bit host=DLserver01
Sun Dec 16 22:45:04 [initandlisten]
Sun Dec 16 22:45:04 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Sun Dec 16 22:45:04 [initandlisten] ** see http://blog.mongodb.org/post/137788967/32-bit-limitations
Sun Dec 16 22:45:04 [initandlisten] ** with --journal, the limit is lower
Sun Dec 16 22:45:04 [initandlisten]
Sun Dec 16 22:45:04 [initandlisten] db version v2.2.2, pdfile version 4.5
Sun Dec 16 22:45:04 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
Sun Dec 16 22:45:04 [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 Dec 16 22:45:04 [initandlisten] options: { repair: true }
Sun Dec 16 22:45:04 [initandlisten] Unable to check for journal files due to: boost::filesystem::basic_directory_iterator constructor: No such file or directory: "/data/db/journal"
Sun Dec 16 22:45:04 [initandlisten] finished checking dbs
Sun Dec 16 22:45:04 dbexit:
Sun Dec 16 22:45:04 [initandlisten] shutdown: going to close listening sockets...
Sun Dec 16 22:45:04 [initandlisten] shutdown: going to flush diaglog...
Sun Dec 16 22:45:04 [initandlisten] shutdown: going to close sockets...
Sun Dec 16 22:45:04 [initandlisten] shutdown: waiting for fs preallocator...
Sun Dec 16 22:45:04 [initandlisten] shutdown: closing all files...
Sun Dec 16 22:45:04 [initandlisten] closeAllFiles() finished
Sun Dec 16 22:45:04 [initandlisten] shutdown: removing fs lock...
Sun Dec 16 22:45:04 dbexit: really exiting now
Which didn't change anything.
What can I do to resolve this? It's an old computer (640MB RAM, single-core P2). Could that be causing it?