Mongodb failed to start

  mongodb, question

Description:

  • Under OS X, a shutdown did not stop mongodb. The mongodb cannot be started after another boot. Always reporting errors:

    MongoDB shell version: 2.4.9
    connecting to: test
    Sat Mar 8 01:32:49.465 Error: couldn’t connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
    exception: connect failed.

  • Google searched and found that the database might be locked, so the mongod.lock file was deleted and MongoD still could not be started.

The log file is as follows:

***** SERVER RESTARTED *****
 
 
 Sat Mar  8 01:32:14.320 [initandlisten] MongoDB starting : pid=1757 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=blurdeMacBook-Air.local
 Sat Mar  8 01:32:14.320 [initandlisten]
 Sat Mar  8 01:32:14.320 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
 Sat Mar  8 01:32:14.320 [initandlisten] db version v2.4.9
 Sat Mar  8 01:32:14.320 [initandlisten] git version: nogitversion
 Sat Mar  8 01:32:14.320 [initandlisten] build info: Darwin minimavericks.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013;  root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
 Sat Mar  8 01:32:14.320 [initandlisten] allocator: tcmalloc
 Sat Mar  8 01:32:14.320 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb",   logappend: "true", logpath: "/usr/local/var/log/mongodb/mongo.log" }
 Sat Mar  8 01:32:14.321 [initandlisten] journal dir=/usr/local/var/mongodb/journal
 Sat Mar  8 01:32:14.321 [initandlisten] recover : no journal files present, no recovery needed
 Sat Mar  8 01:32:14.351 [initandlisten] waiting for connections on port 27017
 Sat Mar  8 01:32:14.351 [websvr] admin web console waiting for connections on port 28017
 Sat Mar  8 01:32:48.121 [signalProcessingThread] got signal 2 (Interrupt: 2), will terminate after current cmd ends
 Sat Mar  8 01:32:48.121 [signalProcessingThread] now exiting
 Sat Mar  8 01:32:48.121 dbexit:
 Sat Mar  8 01:32:48.121 [signalProcessingThread] shutdown: going to close listening sockets  ...
 Sat Mar  8 01:32:48.121 [signalProcessingThread] closing listening socket: 9
 Sat Mar  8 01:32:48.121 [signalProcessingThread] closing listening socket: 10
 Sat Mar  8 01:32:48.121 [signalProcessingThread] closing listening socket: 11
 Sat Mar  8 01:32:48.122 [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
 Sat Mar  8 01:32:48.122 [signalProcessingThread] shutdown: going to flush diaglog  ...
 Sat Mar  8 01:32:48.122 [signalProcessingThread] shutdown: going to close sockets  ...
 Sat Mar  8 01:32:48.122 [signalProcessingThread] shutdown: waiting for fs preallocator  ...
 Sat Mar  8 01:32:48.122 [signalProcessingThread] shutdown: lock for final commit  ...
 Sat Mar  8 01:32:48.122 [signalProcessingThread] shutdown: final commit  ...
 Sat Mar  8 01:32:48.137 [signalProcessingThread] shutdown: closing all files  ...
 Sat Mar  8 01:32:48.137 [signalProcessingThread] closeAllFiles() finished
 Sat Mar  8 01:32:48.137 [signalProcessingThread] journalCleanup  ...
 Sat Mar  8 01:32:48.137 [signalProcessingThread] removeJournalFiles
 Sat Mar  8 01:32:48.137 [signalProcessingThread] shutdown: removing fs lock  ...
 Sat Mar  8 01:32:48.137 dbexit: really exiting now

It’s been a long time, but I haven’t finished it. Please help me, thank you.

Sat Mar  8 01:32:48.121 [signalProcessingThread] got signal 2 (Interrupt: 2), will terminate after current cmd ends

Did you send Ctrl-C to mongod? ?