I installed MongoDB using sudo apt install mongo-org
and followed the instruction to start and everything worked but then when I reboot the system, the MongoDB server failed
● mongodb.service - High-performance, schema-free document-oriented >database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor prese>
Active: failed (Result: exit-code) since Mon 2021-02-15 09:14:37 IST; 2min>
Process: 836 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (c>
Main PID: 836 (code=exited, status=48)
Feb 15 09:14:05 ubuntu systemd[1]: Started High-performance, schema-free docume>
Feb 15 09:14:37 ubuntu systemd[1]: mongodb.service: Main process exited, code=e>
Feb 15 09:14:37 ubuntu systemd[1]: mongodb.service: Failed with result 'exit-co>
I tried changing the permissions of lib/MongoDB and log/mongodb, setting the ulimit of open files to 64000, but nothing worked for me.
What I do till now to do my work is to reinstall MongoDB every time on reboot.
journalctl -e | tee
lsof -i | grep 27017
and see if there is something else — perhaps another instance of MongoDB — appears. If so, that's the problem.