Search This Blog

Monday, June 10, 2013

MongoDB Unclean Shutdown

My laptop battery ran out of juice and dumped all standby data from RAM.  When I booted the system back up, and tried to start my mongodb instance.  I received the following error:

Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.

If you don't want to read through the documentation to fix the error above re-run mongod with the following usage:

mongod(.exe) --repair --repairpath <(c:)/path/to/data> --dbpath <(c:)/path/to/data>


Once it is complete, start mongo db as usual.


Successful Windows Console Output:
C:\dev\mongodb-win32-i386-2.4.4\bin>mongod --repair --repairpath c:/dev/data --d
bpath c:/dev/data
Mon Jun 10 19:22:16.312
Mon Jun 10 19:22:16.312 warning: 32-bit servers don't have journaling enabled by
 default. Please use --journal if you want durability.
Mon Jun 10 19:22:16.328
Mon Jun 10 19:22:16.359 [initandlisten] MongoDB starting : pid=3936 port=27017 d
bpath=c:/dev/data 32-bit host=samson-pc
Mon Jun 10 19:22:16.359 [initandlisten]
Mon Jun 10 19:22:16.359 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Mon Jun 10 19:22:16.359 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Mon Jun 10 19:22:16.359 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
Mon Jun 10 19:22:16.359 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Mon Jun 10 19:22:16.359 [initandlisten]
Mon Jun 10 19:22:16.359 [initandlisten] ** NOTE: your operating system version does not support the method that MongoDB
Mon Jun 10 19:22:16.359 [initandlisten] **       uses to detect impending page faults.
Mon Jun 10 19:22:16.359 [initandlisten] **       This may result in slower performance for certain use cases
Mon Jun 10 19:22:16.359 [initandlisten]
Mon Jun 10 19:22:16.359 [initandlisten] db version v2.4.4
Mon Jun 10 19:22:16.375 [initandlisten] git version: 4ec1fb96702c9d4c57b1e06dd34eb73a16e407d2
Mon Jun 10 19:22:16.375 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB_VERSION=1_49
Mon Jun 10 19:22:16.375 [initandlisten] allocator: system
Mon Jun 10 19:22:16.375 [initandlisten] options: { dbpath: "c:/dev/data", repair: true, repairpath: "c:/dev/data" }
Mon Jun 10 19:22:16.578 [initandlisten] finished checking dbs
Mon Jun 10 19:22:16.578 dbexit:
Mon Jun 10 19:22:16.578 [initandlisten] shutdown: going to close listening sockets...
Mon Jun 10 19:22:16.578 [initandlisten] shutdown: going to flush diaglog...
Mon Jun 10 19:22:16.578 [initandlisten] shutdown: going to close sockets...
Mon Jun 10 19:22:16.578 [initandlisten] shutdown: waiting for fs preallocator...
Mon Jun 10 19:22:16.578 [initandlisten] shutdown: closing all files...
Mon Jun 10 19:22:16.578 [initandlisten] closeAllFiles() finished
Mon Jun 10 19:22:16.578 [initandlisten] shutdown: removing fs lock...
Mon Jun 10 19:22:16.578 dbexit: really exiting now

No comments:

Post a Comment