【centOS】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
同时得删除/tmp/mongodb-27017.sock文件

您好!对于CentOS网络启动失败问题,有几个常见的原因和解决方法: 1. 网络配置错误:检查您的网络配置文件,通常位于`/etc/sysconfig/network-scripts/`目录下,确保配置正确。 - 检查`ifcfg-eth0`文件(或其他以`ifcfg-`开头的文件),确保其中包含正确的IP地址、子网掩码、网关和DNS信息。 - 另外,确认配置文件中的`ONBOOT`选项设置为`yes`,以确保网络接口在启动时自动激活。 2. 网络服务未启动:确保网络服务已正确启动。 - 使用命令`systemctl status network`或`service network status`检查网络服务的状态。如果服务未运行,使用`systemctl start network`或`service network start`启动它。 - 还可以尝试重启网络服务,使用`systemctl restart network`或`service network restart`。 3. 防火墙阻止了网络连接:检查防火墙规则,确保它们不会阻止所需的网络连接。 - 如果使用firewalld作为防火墙管理器,可以使用命令`firewall-cmd --list-all`查看当前的防火墙规则,并根据需要添加允许的规则。 - 如果使用iptables作为防火墙管理器,则可以使用命令`iptables -L`查看规则,并使用相应的命令进行添加或删除。 4. 网络硬件或驱动问题:检查网络接口是否正确识别和加载相关驱动。 - 使用命令`lspci | grep -i eth`检查系统是否正确识别了网络接口。 - 确保正确的驱动程序已安装并加载。您可以使用`lsmod | grep <driver>`命令来检查是否加载了特定的驱动程序。 如果上述方法无法解决问题,您可以提供更多关于具体错误或日志的信息,以便更好地帮助您解决问题
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值