Problem of not starting after restarting mongodb server

Asked 2 years ago, Updated 2 years ago, 120 views

Environment: centos 7 mongodb 2.6

Question: Mongodb is installed and running.
If you restart this server, it should be added to auto start and Mongo should be auto start, but it didn't run, so I checked it.

/var/lib/mongo local could not be opened

This error message did not start.

I was testing it, so I boldly deleted all the contents of the folder, so it started.

But I don't want to do this when I actually do service, so I'd like to know a fundamental solution.

In the case of mongodb, when the server is restarted, does it not just restart? How can I restart mongodb after restarting the server... Please give me an answer.

mongodb linux

2022-09-22 21:51

1 Answers

This is the self-answer I looked for while waiting for your answer.

The workaround is to delete the /var/lib/mongo/mongod.lock file After mongod ---repair, restart mongod and it will work normally.

However, I don't know why I have to do this yet. If there is anyone who knows in more detail, please give me an additional answer.


2022-09-22 21:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.