mongo启动异常-mongodb exception in initAndListen: 7026old lock file, terminating

刚安装上mongo时, 第一次可以启动成功, 第二次的时候就启动不了, 发现没有启动的时候 data下面多了 mongod.lock文件, 里面有个数字, 正常情况下 关闭mongo时该文件大小应该为 0KB

mongo启动异常-mongodb exception in initAndListen: 7026old lock file, terminating_第1张图片

对应的log信息如下:

2015-10-21T08:15:37.546+0800 [initandlisten] MongoDB starting : pid=796 port=27017 dbpath=D:\tools\mongodb-2.6.11\data 32-bit host=YUFU
2015-10-21T08:15:37.546+0800 [initandlisten] 
2015-10-21T08:15:37.546+0800 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2015-10-21T08:15:37.546+0800 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
2015-10-21T08:15:37.546+0800 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
2015-10-21T08:15:37.546+0800 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
2015-10-21T08:15:37.546+0800 [initandlisten] 
2015-10-21T08:15:37.546+0800 [initandlisten] ** NOTE: your operating system version does not support the method that MongoDB
2015-10-21T08:15:37.546+0800 [initandlisten] **       uses to detect impending page faults.
2015-10-21T08:15:37.546+0800 [initandlisten] **       This may result in slower performance for certain use cases
2015-10-21T08:15:37.546+0800 [initandlisten] 
2015-10-21T08:15:37.546+0800 [initandlisten] targetMinOS: Windows XP SP3
2015-10-21T08:15:37.546+0800 [initandlisten] db version v2.6.11
2015-10-21T08:15:37.546+0800 [initandlisten] git version: d00c1735675c457f75a12d530bee85421f0c5548
2015-10-21T08:15:37.546+0800 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
2015-10-21T08:15:37.546+0800 [initandlisten] allocator: system
2015-10-21T08:15:37.546+0800 [initandlisten] options: { storage: { dbPath: "D:\tools\mongodb-2.6.11\data" }, systemLog: { destination: "file", path: "D:\tools\mongodb-2.6.11\logs\mongodb" } }
2015-10-21T08:15:37.546+0800 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
2015-10-21T08:15:37.546+0800 [initandlisten] dbexit: 
2015-10-21T08:15:37.546+0800 [initandlisten] shutdown: going to close listening sockets...
2015-10-21T08:15:37.546+0800 [initandlisten] shutdown: going to flush diaglog...
2015-10-21T08:15:37.546+0800 [initandlisten] shutdown: going to close sockets...
2015-10-21T08:15:37.546+0800 [initandlisten] shutdown: waiting for fs preallocator...
2015-10-21T08:15:37.546+0800 [initandlisten] shutdown: closing all files...
2015-10-21T08:15:37.546+0800 [initandlisten] closeAllFiles() finished
2015-10-21T08:15:37.546+0800 [initandlisten] dbexit: really exiting now

注意加红的的部分: 问题就出现在这个 lock文件上.

解决办法: 删掉lock文件, 在mongo bin 目录下 运行mongod.exe --repair , 然后启动mongo, OK.

你可能感兴趣的:(mongo)