chiefgun 发表于 2015-11-10 14:44:20

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

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



  对应的log信息如下:
  2015-10-21T08:15:37.546+0800 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
2015-10-21T08:15:37.546+0800 ** NOTE: This is a 32 bit MongoDB binary.
2015-10-21T08:15:37.546+0800 **       32 bit builds are limited to less than 2GB of data (or less with --journal).
2015-10-21T08:15:37.546+0800 **       Note that journaling defaults to off for 32 bit and is currently off.
2015-10-21T08:15:37.546+0800 **       See http://dochub.mongodb.org/core/32bit
2015-10-21T08:15:37.546+0800
2015-10-21T08:15:37.546+0800 ** NOTE: your operating system version does not support the method that MongoDB
2015-10-21T08:15:37.546+0800 **       uses to detect impending page faults.
2015-10-21T08:15:37.546+0800 **       This may result in slower performance for certain use cases
2015-10-21T08:15:37.546+0800
2015-10-21T08:15:37.546+0800 targetMinOS: Windows XP SP3
2015-10-21T08:15:37.546+0800 db version v2.6.11
2015-10-21T08:15:37.546+0800 git version: d00c1735675c457f75a12d530bee85421f0c5548
2015-10-21T08:15:37.546+0800 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 allocator: system
2015-10-21T08:15:37.546+0800 options: { storage: { dbPath: "D:\tools\mongodb-2.6.11\data" }, systemLog: { destination: "file", path: "D:\tools\mongodb-2.6.11\logs\mongodb" } }
<span style=&quot;font-family:Microsoft YaHei;font-size:14px;color:#ff0000;&quot;>2015-10-21T08:15:37.546+0800 exception in initAndListen: 12596 old lock file, terminating</span>
2015-10-21T08:15:37.546+0800 dbexit:
2015-10-21T08:15:37.546+0800 shutdown: going to close listening sockets...
2015-10-21T08:15:37.546+0800 shutdown: going to flush diaglog...
2015-10-21T08:15:37.546+0800 shutdown: going to close sockets...
2015-10-21T08:15:37.546+0800 shutdown: waiting for fs preallocator...
2015-10-21T08:15:37.546+0800 shutdown: closing all files...
2015-10-21T08:15:37.546+0800 closeAllFiles() finished
2015-10-21T08:15:37.546+0800 dbexit: really exiting now

注意加红的的部分: 问题就出现在这个 lock文件上.
  解决办法: 删掉lock文件, 在mongo bin 目录下 运行mongod.exe --repair , 然后启动mongo, OK.

版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: mongo启动异常-mongodb exception in initAndListen: 7026old lock file, terminating