2

I got hacked and my entire production database was deleted. Now when I try to start mongod, I get the error:

 Insufficient free space for journal files
 Please make at least 3379MB available in /var/lib/mongo/journal or use --smallfiles

Im on an AWS EC2 instance and have lots of space. What can I try?

I checked /etc/mongod.conf and there is a setting there:

storage:
    dbPath: /var/lib/mongo

However, from the logs, mongod is looking in /data/db. When I then create /data/db I get the error above about insufficient space...

EDIT Ran df -kh /var/lib/mongo which returns

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.8G  4.5G  3.3G  58% /

EDIT

Ok i increased space, that helped but now Im getting yet another error:

Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted

I have tried the solutions here 'Failed to unlink socket file" error in MongoDB 3.0. That is, deleting the file, changing the permissions, but everytime I start mongod, the file reappears and the same error. When I run ls -al on that file I see:

srwx------ 1 mongod mongod 0 Jun  1 18:09 /tmp/mongodb-27017.sock
Mark
  • 4,428
  • 14
  • 60
  • 116

1 Answers1

2

Increasing disk space on my EC2 instance solved the problem.

Mark
  • 4,428
  • 14
  • 60
  • 116
  • Glad you fixed your problem. Just curious. How did you get around the lock permission issue ? – s7vr Jun 02 '17 at 13:10
  • @Veeram deleting /data/db/mongod.lock fixed it for me – Mark Jun 08 '17 at 02:41
  • I am experiencing a similar problem, which appeared out of nowhere. On minute my web app was working, and then it stopped. Did your issue have to do with space or hacking? – MadPhysicist May 10 '18 at 03:51
  • 1
    @MadPhysicist, mine also randomly stopped working and it turned out to be a disk space issue. Start debugging by looking at the actual MongoDB log file. That pointed it out for me. – rockstardev Aug 06 '18 at 16:46