参考:SO: MongoDB: ERROR: child process failed, exited with error number
Check if the mongod is running with pgrep mongod
or ps -aef | grep mongod
or systemctl status mongod
Stop and restart it to check if the issue gone
if you start mongod with mongod -f /etc/mongod.conf
kill it with pkill -9 mongod
then start it with mongod -f /etc/mongod.conf
fi you run it a service, use systemctl restart mongod
to restart it.
If restart not works, figure out the issue by the /var/log/message
and /var/log/mongodb/mongod.log
file.
use tail -f /var/log/message
and tail -f /var/log/mongodb/mongod.log
to check the output when your action.
for example:
1.
Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted
delete the sock file with `rm`
2.
WiredTiger error (13) [1596090168:830936][25997:0x7fe22f208b80], wiredtiger_open: __posix_open_file, 672: /data/mongo/WiredTiger.turtle: handle-open: open: Permission denied Raw: [1596090168:830936][25997:0x7fe22f208b80], wiredtiger_open: __posix_open_file, 672: /data/mongo/WiredTiger.turtle: handle-open: open: Permission denied
Failed to start up WiredTiger under any compatibility version
Reason: 13: Permission denied
check the file permission or owner with `ls` then change to the wright permission with `chmod` or right owner with `chown`