● mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2020-04-20 13:32:29 IST; 6min ago Docs: https://docs.mongodb.org/manual Process: 27917 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=14) Main PID: 27917 (code=exited, status=14) Apr 20 13:32:29 manojkumar systemd[1]: Started MongoDB Database Server. Apr 20 13:32:29 manojkumar systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a Apr 20 13:32:29 manojkumar systemd[1]: mongod.service: Failed with result 'exit-code'.
Asked
Active
Viewed 1.4k times
10

Manoj Kumar Julakanti
- 101
- 1
- 1
- 4
-
1Good practice is to check the logs first and find out the actual cause. Here is the log location `/var/log/mongodb/` – Muhammad Tariq Mar 05 '21 at 05:48
-
You will find the answer here [on Stackoverflow](https://stackoverflow.com/a/65483737/10529914) – Mohamed Sabry May 16 '21 at 21:23
2 Answers
25
It looks like mongo db fails to startup, usually it can be because the lack of permissions on mongodb's internal folders.
Try to check/set:
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock
I've found the thread that talks about here

Mark Bramnik
- 39,963
- 4
- 57
- 97
-
your suggestion worked perfectly. I had initially installed mongodb on WSL/Debian11 over 5 weeks ago and just now getting to use it. During that install, I had forgot to change the user/group. – Energetic Pixels Jul 16 '23 at 13:16
1
To whoever comes here with the same problem of not able to start mongodb with the command (sudo systemctl status mongod) after successful installation:
I had to set ulimit -n 64000 to get it to work. This is actually mentioned in the installation docs here which I had ignored initially.

hebbarp
- 11
- 4