原因:MongoDB未正常关闭导致的

解决:

  1. 找到dbpath里的mongod.lock文件,删除mongod.lock文件;例如(/usr/local/mongodb/data文件中)
  2. 以管理身份启动:sudo /usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongodb.conf
    [ec2-user@ip-172-31-43-102 bin]$ ./mongod --config /usr/local/mongodb/bin/mongodb.conf
    about to fork child process, waiting until server is ready for connections.
    forked process: 4099
    ERROR: child process failed, exited with error number 14
    To see additional information in this output, start without the "--fork" option.
    [ec2-user@ip-172-31-43-102 bin]$ sudo su
    [root@ip-172-31-43-102 bin]# cd /usr/local/mongodb/bin
    [root@ip-172-31-43-102 bin]# ./mongod --config /usr/local/mongodb/bin/mongodb.conf
    about to fork child process, waiting until server is ready for connections.
    forked process: 4131
    child process started successfully, parent exiting
  3. 查看进程是否运行 ps -aux | grep mongod

 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐