温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

mongoDB启动失败问题解决

发布时间:2020-06-12 04:25:30 来源:网络 阅读:2834 作者:zbylovecool 栏目:MongoDB数据库

system :centOS 5.5 

View Log:
[root@localhost mongo]# tail -20 /usr/local/mongo/mongodb.log

Mon Sep 19 06:14:55 [initandlisten] MongoDB starting : pid=4126 port=27017 dbpath=/usr/local/mongo/data 64-bit 

Mon Sep 19 06:14:55 [initandlisten] db version v1.8.1, pdfile version 4.5
Mon Sep 19 06:14:55 [initandlisten] git version: nogitversion
Mon Sep 19 06:14:55 [initandlisten] build sys info: Linux localhost.localdomain 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 
 
BOOST_LIB_VERSION=1_33_1
************** 
old lock file: /usr/local/mongo/data/mongod.lock.  probably means unclean shutdown
recommend removing file and running --repair
see: http://dochub.mongodb.org/core/repair for more information
*************
Mon Sep 19 06:14:55 [initandlisten] exception in initAndListen std::exception: old lock file, terminating
Mon Sep 19 06:14:55 dbexit: 
Mon Sep 19 06:14:55 [initandlisten] shutdown: going to close listening sockets...
Mon Sep 19 06:14:55 [initandlisten] shutdown: going to flush diaglog...
Mon Sep 19 06:14:55 [initandlisten] shutdown: going to close sockets...
Mon Sep 19 06:14:55 [initandlisten] shutdown: waiting for fs preallocator...
Mon Sep 19 06:14:55 [initandlisten] shutdown: closing all files...
Mon Sep 19 06:14:55 closeAllFiles() finished
Mon Sep 19 06:14:55 dbexit: really exiting now
 
Analysis:If a server running MongoDB crashed or MongoDB did not get to shut down cleanly for some other reason, you may not be able to start Mongo again, getting "exception in initAndListen std::exception: old lock file, terminating" error in Mongo error log.
 
Fix is actually pretty easy, you just need to locate mongod.lock file and remove it.
 
[root@localhost mongo]#rm -rf /usr/local/mongo/data/mongod.lock
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI