Mongo DB keep on crashing automatically and all database and collection remove automatically.This is happening randomly and when I check mongod.log I can see it's automatically dropped.
Today I got the error message that mongo service unable to start, and when I start it services it give me the error
Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.
when I type this command
systemctl status mongod.service
Debian Server Configuration are: 40GB HHD 4GB RAM
I have around 2 million data as of now in mongoDB and it will increase day by day.
I have down so much of google but didn't find the perfect solution and as I'm not an expert at server level ,so can some give a suggestion or solution to how can I get rid with this problem.
Best Answer
That first log file tells that "client" connects to the server and gives dropDatabase command, so check your application. Why it executes dropDatabase.
What comes to the second problem, you need to check your mongodb.log, what it tells for the reason, why mongodb cannot start. Wild guess is ownership of some files (data, lock, log), all files must be owned by user what you use to start mongod process (probably mongodb -user) Name and location of mongodb.log, you can find from
/etc/mongod.conf
-file