MongoDB error 32 bit servers don't journaling enabled by default solution

  • 2020-05-14 05:17:21
  • OfStack

Every time you start MongoDB, you will receive the following Unclean shutdown prompt, which summarizes the reasons and solutions for this problem in 1.

Here's a hint:


**************
D:\GREENT~1\PowerCmd>mongod --auth -dbpath C:\mongo\MongoDB\mongo\data
Wed May 16 16:06:50
Wed May 16 16:06:50 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed May 16 16:06:50
Wed May 16 16:06:50 [initandlisten] MongoDB starting : pid=5016 port=27017 dbpath=C:\mongo\MongoDB\mongo\data 32-bit host=mxh
Wed May 16 16:06:50 [initandlisten]
Wed May 16 16:06:50 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Wed May 16 16:06:50 [initandlisten] **       see http://blog.mongodb.org/post/137788967/32-bit-limitations
Wed May 16 16:06:50 [initandlisten] **       with --journal, the limit is lower
Wed May 16 16:06:50 [initandlisten]
Wed May 16 16:06:50 [initandlisten] db version v2.0.1, pdfile version 4.5
Wed May 16 16:06:50 [initandlisten] git version: 3a5cf0e2134a830d38d2d1aae7e88cac31bdd684
Wed May 16 16:06:50 [initandlisten] build info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LIB_VERSION=1_42
Wed May 16 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 May 16 16:06:51 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Wed May 16 16:06:51 dbexit:
Wed May 16 16:06:51 [initandlisten] shutdown: going to close listening sockets...
Wed May 16 16:06:51 [initandlisten] shutdown: going to flush diaglog...
Wed May 16 16:06:51 [initandlisten] shutdown: going to close sockets...
Wed May 16 16:06:51 [initandlisten] shutdown: waiting for fs preallocator...
Wed May 16 16:06:51 [initandlisten] shutdown: closing all files...
Wed May 16 16:06:51 [initandlisten] closeAllFiles() finished
Wed May 16 16:06:51 dbexit: really exiting now

After many tests, it was found that the reason for this situation was that I directly closed PowerCMD window after starting MongoDB with PowerCMD. If I used the [ctrl + c] shortcut to terminate mongod before closing PowerCMD window, this situation would not happen. Also, running the mongo command using a normal CMD window doesn't cause this problem even if you close the window directly, so it seems more sensible to use a native program.

When this happens, the solution is also very simple. The following parameter repair can be used:


mongod --auth -dbpath C:\mongo\MongoDB\mongo\data --repair

Then reboot:


D:\GREENT~1\PowerCmd>mongod --auth -dbpath C:\mongo\MongoDB\mongo\data
Wed May 16 16:44:35
Wed May 16 16:44:35 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed May 16 16:44:35
Wed May 16 16:44:35 [initandlisten] MongoDB starting : pid=9616 port=27017 dbpath=C:\mongo\MongoDB\mongo\data 32-bit host=mxh
Wed May 16 16:44:35 [initandlisten]
Wed May 16 16:44:35 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Wed May 16 16:44:35 [initandlisten] **       see http://blog.mongodb.org/post/137788967/32-bit-limitations
Wed May 16 16:44:35 [initandlisten] **       with --journal, the limit is lower
Wed May 16 16:44:35 [initandlisten]
Wed May 16 16:44:35 [initandlisten] db version v2.0.1, pdfile version 4.5
Wed May 16 16:44:35 [initandlisten] git version: 3a5cf0e2134a830d38d2d1aae7e88cac31bdd684
Wed May 16 16:44:35 [initandlisten] build info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LIB_VERSION=1_42
Wed May 16 16:44:35 [initandlisten] options: { auth: true, dbpath: "C:\mongo\MongoDB\mongo\data" }
Wed May 16 16:44:35 [initandlisten] waiting for connections on port 27017
Wed May 16 16:44:35 [websvr] admin web console waiting for connections on port 28017

There are still some cases that can cause Unclean shutdown. The solution can be found in the official documentation:

http://www.mongodb.org/display/DOCS/Durability+and+Repair


Related articles: