zoukankan      html  css  js  c++  java
  • 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# 
  • 相关阅读:
    Java学习的第五十一天
    Java学习的第五十四天
    Java学习的第五十天
    Java学习的第五十三天
    Java学习的第五十二天
    Java学习的第四十九天
    构造函数
    封 装
    JAVA学习日报 10/8
    JAVA学习日报 10.11
  • 原文地址:https://www.cnblogs.com/zlslch/p/6932368.html
Copyright © 2011-2022 走看看