Every time you start MongoDB will always receive the following unclean shutdown prompts, summed up the cause of the problem and the solution.
The prompts are as follows:
Copy Code code as follows:
**************
D:\greent~1\powercmd>mongod--auth-dbpath C:\mongo\MongoDB\mongo\data
Wed May 16 16:06:50
Wed 16:06:50 warning:32-bit servers don ' t have journaling enabled by default. Please use the--journal if you want durability.
Wed May 16 16:06:50
Wed may 16:06:50 [Initandlisten] MongoDB starting:pid=5016 port=27017 dbpath=c:\mongo\mongodb\mongo\data 32-bit host= Mxh
Wed may 16:06:50 [Initandlisten]
Wed may 16:06:50 [Initandlisten] * * note:when using MongoDB bit, you are limited to about 2 gigabytes of data
Wed may 16:06:50 [Initandlisten] * * * http://blog.mongodb.org/post/137788967/32-bit-limitations
Wed may 16:06:50 [Initandlisten] * * with--journal, the limit is lower
Wed may 16:06:50 [Initandlisten]
Wed may 16:06:50 [Initandlisten] db version v2.0.1, pdfile version 4.5
Wed may 16:06:50 [Initandlisten] git version:3a5cf0e2134a830d38d2d1aae7e88cac31bdd684
Wed 16:06:50 [Initandlisten] Build Info:windows (5, 1, 2600, 2, ' Service Pack 3 ') boost_lib_version=1_42
Wed may 16:06:50 [Initandlisten] Options: {auth:true, DBPath: "C:\mongo\MongoDB\mongo\data"}
**************
Unclean shutdown detected.
Please visit Http://dochub.mongodb.org/core/repair for recovery instructions.
*************
Wed 16:06:51 [Initandlisten] exception in initandlisten:12596 old lock file, terminating
Wed May 16:06:51 Dbexit:
Wed 16:06:51 [Initandlisten] shutdown:going to close listening sockets ...
Wed 16:06:51 [Initandlisten] shutdown:going to flush diaglog ...
Wed 16:06:51 [Initandlisten] shutdown:going to close sockets ...
Wed 16:06:51 [Initandlisten] shutdown:waiting for FS preallocator ...
Wed 16:06:51 [Initandlisten] shutdown:closing All Files ...
Wed may 16:06:51 [Initandlisten] Closeallfiles () finished
Wed 16:06:51 dbexit:really exiting now
After a number of tests, I found that this was caused by the fact that after I started MongoDB with Powercmd, I turned off the powercmd window and used [Ctrl + C] Before closing the Powercmd window. This is not the case when the shortcut key terminates the Mongod operation. Also, using the normal CMD window to run the MONGO command even if you close the window does not appear this problem, it seems that the use of native programs more reliable.
The solution to this situation is also simple, using the following parameter repair:
Copy Code code as follows:
Mongod--auth-dbpath C:\mongo\MongoDB\mongo\data--repair
Then reboot:
Copy Code code as follows:
D:\greent~1\powercmd>mongod--auth-dbpath C:\mongo\MongoDB\mongo\data
Wed May 16 16:44:35
Wed 16:44:35 warning:32-bit servers don ' t have journaling enabled by default. Please use the--journal if you want durability.
Wed May 16 16:44:35
Wed may 16:44:35 [Initandlisten] MongoDB starting:pid=9616 port=27017 dbpath=c:\mongo\mongodb\mongo\data 32-bit host= Mxh
Wed may 16:44:35 [Initandlisten]
Wed may 16:44:35 [Initandlisten] * * note:when using MongoDB bit, you are limited to about 2 gigabytes of data
Wed may 16:44:35 [Initandlisten] * * * http://blog.mongodb.org/post/137788967/32-bit-limitations
Wed may 16:44:35 [Initandlisten] * * with--journal, the limit is lower
Wed may 16:44:35 [Initandlisten]
Wed may 16:44:35 [Initandlisten] db version v2.0.1, pdfile version 4.5
Wed may 16:44:35 [Initandlisten] git version:3a5cf0e2134a830d38d2d1aae7e88cac31bdd684
Wed 16:44:35 [Initandlisten] Build Info:windows (5, 1, 2600, 2, ' Service Pack 3 ') boost_lib_version=1_42
Wed may 16:44:35 [Initandlisten] Options: {auth:true, DBPath: "C:\mongo\MongoDB\mongo\data"}
Wed 16:44:35 [Initandlisten] waiting for connections on port 27017
Wed 16:44:35 [websvr] Admin Web console waiting for connections on port 28017
There are also situations that can cause this unclean shutdown, and the solution may refer to the official documentation:
Http://www.mongodb.org/display/DOCS/Durability+and+Repair