MongoDB won't start after server crash

前端 未结 8 1242
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 18:29

My Ubuntu computer had crashed, and when I restarted it MongoDB wasn\'t working. I tried the following commands, and got the following output:

$ mongo
Error:         


        
8条回答
  •  伪装坚强ぢ
    2020-11-28 18:51

    Based on my experience, I usually delete the "mongod.lock" file that is inside the database folder - In my case:

    *I browse to where the database is installed on my ubuntu i.e. "data" folder.(cd data); list the files (ls) *Then, I will remove the "mongod.lock" file that was automatically created when the database crashed, by issuing "rm mongod.lock" file.

    After which I will either issue "./mongod" to start the mongo deamon or mongo to start the mongo shell. And everything will be fine.

提交回复
热议问题