Error: child process failed, exited with error number 1
It’s usually a matter of permissions, or there is no corresponding path
Check steps: add a parameter after startup to export the log to a writable directory
./mongod –fork –logpath=/tmp/ mongod.log
Then look at the questions as follows:
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
This means that there is no such directory (/ var/run/mongodb /)
Then create a new one, MKDIR – P/var/run/mongodb/
The normal restart is 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