Whenever I restart my system MongoDB server fails to start.
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-07-03 14:24:44 IST; 15min ago
Docs: https://docs.mongodb.org/manual
Process: 14963 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 14963 (code=exited, status=1/FAILURE)
The only solution for this is to run
sudo mongod --fork --logpath /var/lib/mongodb/mongodb.log --dbpath /var/lib/mongodb
after the system restart.
But it gets annoying to start MongoDB every time on system restart.
Is there any other solution to this problem?