Getting error while starting mongodb server

Viewed 1201

I am running on ubuntu 20.04. First, when I installed it worked correctly. But after restarting desktop it is giving me an error.

mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2020-07-07 10:45:07 IST; 4min 47s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 8324 (code=exited, status=14)

Jul 07 10:45:04 pop-os systemd[1]: Started MongoDB Database Server.
Jul 07 10:45:07 pop-os systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
Jul 07 10:45:07 pop-os systemd[1]: mongod.service: Failed with result 'exit-code'.
Jul 07 10:49:49 pop-os systemd[1]: /lib/systemd/system/mongod.service:11: PIDFile= references a path below legacy directory /var/run/>
1 Answers

I ran in to the same issue - checking /var/log/mongodb/mongodb.log showed that there wasn't enough disk space for the journal files:

2020-11-08T16:04:02.510+0000 E JOURNAL  [initandlisten] Insufficient free space for journal files
2020-11-08T16:04:02.510+0000 I JOURNAL  [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
2020-11-08T16:04:02.510+0000 I JOURNAL  [initandlisten] 
2020-11-08T16:04:02.510+0000 I STORAGE  [initandlisten] exception in initAndListen: Location15926: Insufficient free space for journals, terminating
2020-11-08T16:04:02.510+0000 I REPL     [initandlisten] Stepping down the ReplicationCoordinator for shutdown, waitTime: 10000ms
2020-11-08T16:04:02.510+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2020-11-08T16:04:02.510+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2020-11-08T16:04:02.510+0000 I NETWORK  [initandlisten] Shutting down the global connection pool
2020-11-08T16:04:02.510+0000 I REPL     [initandlisten] Shutting down the ReplicationCoordinator
2020-11-08T16:04:02.510+0000 I REPL     [initandlisten] shutting down replication subsystems

Freeing up some space solved the issue for me.

Related