如何启动mongodb。子进程失败。
-bash-4.1$ mongod --config /mongodb/etc/mongod-ctr.conf
about to fork child process, waiting until server is ready for connections.
forked process: 22965
ERROR: child process failed, exited with error number 48
-bash-4.1$ mongo
MongoDB shell version v3.4.17
connecting to: mongodb://127.0.0.1:27017
2018-11-27T13:52:13.826-0500 W NETWORK [thread1] Failed to
connect to 127.0.0.1:27017, in(checking socket for error after
poll), reason: Connection refused
答案 0 :(得分:1)
根据MongoDB error code manual和您的错误状态,似乎在端口27017上正在运行另一个进程,或者您没有正确的权限。
您可以使用命令lsof -i -P -n
查看所有应用程序及其使用的端口的列表。