mongodb啟動(dòng)時(shí)報(bào)錯(cuò)如下:
[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文件權(quán)限
chown mongod:mongod /tmp/mongodb-27017.sock