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