mongodb启动时报错ERROR: child process failed, exited with error number 1
不多说,直接上干货!
前期博客
Ubuntu14.04下Mongodb安装部署步骤(图文详解)
Ubuntu16.04下Mongodb安装部署步骤(图文详解)
root@zhouls-virtual-machine:/usr/local/mongodb/bin# ls bsondump mongodump mongoimport mongoreplay mongostat mongo mongoexport mongooplog mongorestore mongotop mongod mongofiles mongoperf mongos root@zhouls-virtual-machine:/usr/local/mongodb/bin# ./mongod --dbpath=/usr/local/mongodb/data/ --fork --logpath=/usr/local/mongodb/log about to fork child process, waiting until server is ready for connections. forked process: 5784 ERROR: child process failed, exited with error number 1 root@zhouls-virtual-machine:/usr/local/mongodb/bin#
失败的原因
是因为通过service MongoDB restart时启动失败,或者如果是直接kill 掉来关闭都会出现这种情况
是因为没有正常关闭导致的。
是因为你的配置目录,是否应该要是log配置文件,而很多人都写成了log目录。
解决办法
zhouls@zhouls-virtual-machine:~$ sudo ufw disable [sudo] password for zhouls: Firewall stopped and disabled on system startup zhouls@zhouls-virtual-machine:~$
root@zhouls-virtual-machine:/usr/local/mongodb# ls bin data GNU-AGPL-3.0 log MPL-2 README THIRD-PARTY-NOTICES root@zhouls-virtual-machine:/usr/local/mongodb# rm -rf log/ root@zhouls-virtual-machine:/usr/local/mongodb# ls bin data GNU-AGPL-3.0 MPL-2 README THIRD-PARTY-NOTICES root@zhouls-virtual-machine:/usr/local/mongodb# touch log root@zhouls-virtual-machine:/usr/local/mongodb# cd bin root@zhouls-virtual-machine:/usr/local/mongodb/bin# pwd /usr/local/mongodb/bin root@zhouls-virtual-machine:/usr/local/mongodb/bin# ls bsondump mongodump mongoimport mongoreplay mongostat mongo mongoexport mongooplog mongorestore mongotop mongod mongofiles mongoperf mongos root@zhouls-virtual-machine:/usr/local/mongodb/bin# ./mongod --dbpath=/usr/local/mongodb/data/ --fork --logpath=/usr/local/mongodb/log about to fork child process, waiting until server is ready for connections. forked process: 6072 child process started successfully, parent exiting root@zhouls-virtual-machine:/usr/local/mongodb/bin#
作者:大数据和人工智能躺过的坑
出处:http://www.cnblogs.com/zlslch/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。
如果您认为这篇文章还不错或者有所收获,您可以通过右边的“打赏”功能 打赏我一杯咖啡【物质支持】,也可以点击右下角的【好文要顶】按钮【精神支持】,因为这两种支持都是我继续写作,分享的最大动力!