-2

My mongo has stopped running:

$ sudo systemctl status mongodb.service
● mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/usr/lib/systemd/system/mongodb.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-01-05 02:26:08 GMT; 8min ago
  Process: 27887 ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf (code=exited, status=1/FAILURE)
 Main PID: 27887 (code=exited, status=1/FAILURE)

Jan 05 02:26:08 localhost systemd[1]: Started High-performance, schema-free document-oriented database.
Jan 05 02:26:08 localhost systemd[1]: mongodb.service: Main process exited, code=exited, status=1/FAILURE
Jan 05 02:26:08 localhost systemd[1]: mongodb.service: Unit entered failed state.
Jan 05 02:26:08 localhost systemd[1]: mongodb.service: Failed with result 'exit-code'.

I think probably it is running out of space:

$ df -h /var/lib/mongodb/
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        38G   38G     0 100% /

How can I fix this? Can we increase the the size for it?

I am on Arch Linux, from its wiki:

Check that there is at least 3GB space available for its journal files, otherwise mongodb can fail to start (without issuing a message to the user):

$ df -h /var/lib/mongodb/

Or is it /dev/root that I should increase (how do I increase it)?

Any ideas?

Run
  • 101
  • 7
  • 2
    If you can’t free up space by deleting old data then you can either add an extra disk and move your DB data there, or if the current disk allows it you can increase the root partition and root file system. How depends on your hardware, virtual server or real hardware, current disk layout etc and is the basic stuff that is quite well documented ... – HBruijn Jan 05 '18 at 07:03
  • @HBruijn thanks for the comment. will find out from my host which is linode. – Run Jan 05 '18 at 13:23

1 Answers1

1

You may be able to get get a better idea of exactly what the problem is by running journalctl -xe and examining the output but a full disk does seem the likely cause.

First use site search to find Q&A about how to determine what is filling your disk and how (if possible) to resolve it.

If you find that for example a log file has grown too big then deleting it is a easy fix.

If you really need more disk space then you will have to arrange with your hosting provider to add additional disks, Format it and then mount it into a temporary location. Then copy your mongodb data on to the new disk. Verify that it's a good copy. Delete the old data, mount the new disk in the appropriate location and finally update the /etc/fstab as appropriate.

user9517
  • 115,471
  • 20
  • 215
  • 297