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

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

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

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

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐