search

Home  >  Q&A  >  body text

意外重启后,mongodb无法链接,stop服务时提示"stop: Unknown instance"

ubuntu系统,早上启动不起来。只好复位键强行重启后,执行

>> sudo service mongodb start
mongodb start/running, process 1059

但是发现无法链接,然后执行

>> sudo service mongodb stop
stop: Unknown instance

搞不懂了,怎么办?

巴扎黑巴扎黑2767 days ago710

reply all(3)I'll reply

  • PHPz

    PHPz2017-04-21 11:19:21

    Try deleting the mongo.lock file in the data folder and restarting

    reply
    0
  • 高洛峰

    高洛峰2017-04-21 11:19:21

    Check if mongdb is indeed running, if so it can be used

    sudo mongod --shutdown --dbpath <PATH_TO_DB>

    reply
    0
  • PHPz

    PHPz2017-04-21 11:19:21

    It should be caused by abnormal shutdown.
    linux:
    sudo top, check to see if there is a process running mongo. If so, kill it and try starting mongo.

    reply
    0
  • Cancelreply