How to resolve error :dbpath (/data/db/) does not exist permanently in MongoDB

前端 未结 5 378
旧巷少年郎
旧巷少年郎 2021-01-30 13:04

I have installed mongodb in my Ubuntu 10.04.

I know that when it comes to start the mongodb server with the command \"mongod\",then it expects /data/db

5条回答
  •  面向向阳花
    2021-01-30 13:39

    1. Find mongo log file from root system folder

    sudo find / -name "mongodb.log" -type f

    result: /var/log/mongodb/mongodb.log

    1. open /var/log/mongodb/mongodb.log

    2. search for last "exception" word

    3. try to correct exception

    In my case exception was the next: 2015-07-30T15:09:15.806+0300 [initandlisten] exception in initAndListen: 13597 can't start without --journal enabled when journal/ files are present, terminating

    I made the next:

    1. cd /var/lib/mongodb
    2. rm -r journal/

提交回复
热议问题