mongodb 启动报错 ERROR: child process failed, exited with error number 1

  • Post author:
  • Post category:其他


mongodb 启动报错 ERROR: child process failed, exited with error number 1

一般是权限的问题,或者没有相应的路径

检查步骤: 启动时在后面加一个参数,将日志导出到一个可 写的目录:

./mongod –fork –logpath=/tmp/mongod.log

然后查看问题如下:

2017-02-22T01:33:34.229+0800 I CONTROL  [main] ERROR: Cannot write pid file to /var/run/mongodb/mongod.pid: No such file or directory

意思是没有这个目录(/var/run/mongodb/)

然后新建它就好了 mkdir -p /var/run/mongodb/

再正常启动如下:

root@sz:~/soft/mongodb342/bin# ./mongod -f  /etc/mongodb/mongod.conf

about to fork child process, waiting until server is ready for connections.

forked process: 7482

child process started successfully, parent exiting



版权声明:本文为wang1144原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。