mongoDB非正常关闭后无法启动问题


D:\mongodb\bin>mongod.exe --dbpath D:\mongodb\data\db
Mon Dec 16 14:39:31.276
Mon Dec 16 14:39:31.278 warning: 32-bit servers don't have journaling enabled by default. Please use --jour
Mon Dec 16 14:39:31.279
Mon Dec 16 14:39:31.293 [initandlisten] MongoDB starting : pid=2760 port=27017 dbpath=D:\mongodb\data\db 32
Mon Dec 16 14:39:31.294 [initandlisten]
Mon Dec 16 14:39:31.295 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Mon Dec 16 14:39:31.295 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or les
Mon Dec 16 14:39:31.296 [initandlisten] **       Note that journaling defaults to off for 32 bit and is cur
Mon Dec 16 14:39:31.296 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Mon Dec 16 14:39:31.297 [initandlisten]
Mon Dec 16 14:39:31.297 [initandlisten] db version v2.4.8
Mon Dec 16 14:39:31.298 [initandlisten] git version: a350fc38922fbda2cec8d5dd842237b904eafc14
Mon Dec 16 14:39:31.299 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=0, build=6
_LIB_VERSION=1_49
Mon Dec 16 14:39:31.300 [initandlisten] allocator: system
Mon Dec 16 14:39:31.300 [initandlisten] options: { dbpath: "D:\mongodb\data\db" }
**************
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
Mon Dec 16 14:39:31.314 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Mon Dec 16 14:39:31.314 dbexit:
Mon Dec 16 14:39:31.315 [initandlisten] shutdown: going to close listening sockets...
Mon Dec 16 14:39:31.315 [initandlisten] shutdown: going to flush diaglog...
Mon Dec 16 14:39:31.316 [initandlisten] shutdown: going to close sockets...
Mon Dec 16 14:39:31.317 [initandlisten] shutdown: waiting for fs preallocator...
Mon Dec 16 14:39:31.317 [initandlisten] shutdown: closing all files...
Mon Dec 16 14:39:31.318 [initandlisten] closeAllFiles() finished
Mon Dec 16 14:39:31.318 dbexit: really exiting now




解决方法:
 
1、删除%MONGO_HOME%/db下的.lock文件
 
2、输入命令 mongod --repair
 
3、重启mongoDB




你可能感兴趣的:(MongoDB)