Friday, June 5, 2015

MongoDB server Failed to start : Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty

If you are unable to start the MongoDB server and getting below kind of error then the solution will here.


Simply delete the file mongod.lock that is available in the specified path and try to restart the server by executing the below command:

                                               #sudo service mongod start


Error Code:

2015-06-05T01:54:42.164-0700 I JOURNAL  [journal writer] Journal writer thread started
2015-06-05T01:54:42.552-0700 I NETWORK  [initandlisten] waiting for connections on port 27017
2015-06-05T02:04:07.193-0700 I CONTROL  ***** SERVER RESTARTED *****
2015-06-05T02:04:07.279-0700 E NETWORK  [initandlisten] listen(): bind() failed errno:98 Address already in use for socket:127.0.0.1:27017
2015-06-05T02:04:07.279-0700 E NETWORK  [initandlisten]   addr already in use
2015-06-05T02:04:07.281-0700 W -        [initandlisten] Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty.
2015-06-05T02:04:09.673-0700 I STORAGE  [initandlisten] exception in initAndListen: 98 Unable to lock file: /var/lib/mongo/mongod.lock errno:11 Resource temporarily unavailable. Is a mongod instance already running?, terminating

No comments:

Post a Comment