mongodb startup ERROR ERROR: child process failed, exited with ERROR number 1
is usually a problem of permissions, or there is no corresponding path
check step: add a parameter after startup to export the log to a writable directory :
./mongod –fork –logpath=/tmp/mongod.log
then check the problem as follows :
2017-02-22 T01:33:34. 229 + 0800 I CONTROL [main] ERROR: always write a pid file to/var/run/mongo/mongod. Pid: No to the file or directory
p>
means there is no such directory (/var/run/mongodb/)
and I’m just going to create a new mkdir -p /var/run/mongodb/
starts normally again as follows:
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