mongodb启动时报错如下:
[root@Sirun-015 ~]# service mongod status
mongod dead but subsys locked
[root@Sirun-015 ~]# service mongod start
Error starting mongod. /var/run/mongodb/mongod.pid exists.
You have new mail in /var/spool/mail/root
解决方法:
查看 mongod.pid
[root@Sirun-015 ~]# cd /var/run/mongodb/
You have mail in /var/spool/mail/root
[root@Sirun-015 mongodb]# ll
total 4
-rw-r--r-- 1 mongod mongod 5 Sep 9 19:00 mongod.pid
[root@Sirun-015 mongodb]#
[root@Sirun-015 mongodb]# rm -rf mongod.pid
[root@Sirun-015 mongodb]# service mongod start
Starting mongod: [ OK ]
You have mail in /var/spool/mail/root
1、删除mongod.pid文件
rm -rf /var/run/mongodb/mongod.pid
2、修改/tmp/mongodb-27017.sock文件权限
chown mongod:mongod /tmp/mongodb-27017.sock
网友评论