每次启动MongoDB时总是会收到如下 Unclean shutdown 提示,总结了一下出现该问题的原因及解决方法。
提示如下:
复制代码 代码如下:
**************
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
经过多次测试发现,造成这种情况的原因是我使用PowerCMD启动MongoDB之后直接关掉PowerCMD窗口之后造成的,如果在关闭PowerCMD窗口之前使用 [ctrl + c] 快捷键终止mongod的运行也不会出现此种情况。而且,使用普通的CMD窗口运行mongo命令即使直接关掉窗口也不会出现该问题,看来还是使用原生程序更靠谱。
发生了此种情况解决方法也很简单,使用如下参数repair即可:
复制代码 代码如下:
mongod --auth -dbpath C:\mongo\MongoDB\mongo\data --repair
然后重新启动即可:
复制代码 代码如下:
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
还有一些情况会造成这种 Unclean shutdown,解决方法可参考官方文档:
http://www.mongodb.org/display/DOCS/Durability+and+Repair
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 黄乙玲1988-无稳定的爱心肝乱糟糟[日本东芝1M版][WAV+CUE]
- 群星《我们的歌第六季 第3期》[320K/MP3][70.68MB]
- 群星《我们的歌第六季 第3期》[FLAC/分轨][369.48MB]
- 群星《燃!沙排少女 影视原声带》[320K/MP3][175.61MB]
- 乱斗海盗瞎6胜卡组推荐一览 深暗领域乱斗海盗瞎卡组分享
- 炉石传说乱斗6胜卡组分享一览 深暗领域乱斗6胜卡组代码推荐
- 炉石传说乱斗本周卡组合集 乱斗模式卡组最新推荐
- 佟妍.2015-七窍玲珑心【万马旦】【WAV+CUE】
- 叶振棠陈晓慧.1986-龙的心·俘虏你(2006复黑限量版)【永恒】【WAV+CUE】
- 陈慧琳.1998-爱我不爱(国)【福茂】【WAV+CUE】
- 咪咕快游豪礼放送,百元京东卡、海量欢乐豆就在咪咕咪粉节!
- 双11百吋大屏焕新“热”,海信AI画质电视成最大赢家
- 海信电视E8N Ultra:真正的百吋,不止是大!
- 曾庆瑜1990-曾庆瑜历年精选[派森][WAV+CUE]
- 叶玉卿1999-深情之选[飞图][WAV+CUE]