mongodb使用fork启动报错问题

AmsChan ... 2021-03-08 数据库
  • Mongodb
  • Linux
小于 1 分钟

在我使用以下命令启动mongodb时,报以下错误。

mongod --dbpath /usr/local/bin/mongodb/data/db --logpath /usr/local/bin/mongodb/log  --fork
1
ERROR: child process failed, exited with error code 1
To see additional information in this output, start without the "--fork" option.
1
2

原因一般是配置目录错误,我这里是log的路径配置错误,在log目录下新建空白文件“logs.log”,然后执行以下命令即可

mongod --dbpath /usr/local/bin/mongodb/data/db --logpath /usr/local/bin/mongodb/log/logs  --fork
1
about to fork child process, waiting until server is ready for connections.
forked process: 7930
child process started successfully, parent exiting
1
2
3