mongodb 在centos7里用systemctl起不来

两个问题造成

1、/var/run/mongodb/mongod.pid 文件已存在

2、logpath和dbpath下的文件的权限问题:都得用

sudo chown mongod:mongod /mongo/data /mongo/journal /mongo/log

systemctl status mongod.service

mongod.service - SYSV: Mongo is a scalable, document-oriented database.

   Loaded: loaded (/etc/rc.d/init.d/mongod)

   Active: failed (Result: exit-code) since 一 2016-11-14 17:09:36 CST; 14s ago

     Docs: man:systemd-sysv-generator(8)

  Process: 27470 ExecStop=/etc/rc.d/init.d/mongod stop (code=exited, status=0/SUCCESS)

  Process: 28346 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)


11月 14 17:09:36 iZbp1b27exwwfpa1a3osj5Z systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database....

11月 14 17:09:36 iZbp1b27exwwfpa1a3osj5Z mongod[28346]: Error starting mongod. /var/run/mongodb/mongod.pid exists.

11月 14 17:09:36 iZbp1b27exwwfpa1a3osj5Z systemd[1]: mongod.service: control process exited, code=exited status=1

11月 14 17:09:36 iZbp1b27exwwfpa1a3osj5Z systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..

11月 14 17:09:36 iZbp1b27exwwfpa1a3osj5Z systemd[1]: Unit mongod.service entered failed state.

11月 14 17:09:36 iZbp1b27exwwfpa1a3osj5Z systemd[1]: mongod.service failed.




你可能感兴趣的:(mongodb 在centos7里用systemctl起不来)