3

I've seen the strange behavior of my server and first of all I looked at log file /var/log/mongodb/mongodb.log. There I saw the next lines:

Wed Jan  7 16:33:31 [FileAllocator] allocating new datafile /var/lib/mongodb/salesg_call_log.1, filling with zeroes...
Wed Jan  7 16:33:31 [FileAllocator] FileAllocator: posix_fallocate failed: errno:28 No space left on device falling back
Wed Jan  7 16:33:31 [FileAllocator] error failed to allocate new file: /var/lib/mongodb/salesg_call_log.1 size: 33554432 errno:28 No space left on device
Wed Jan  7 16:33:31 [FileAllocator]     will try again in 10 seconds

I guess that it means that there is no free disk space on my server.

Then I typed command df -h:

Filesystem                                  Size  Used Avail Use% Mounted on
rootfs                                      9.3G  2.5G  6.5G  28% /
udev                                         10M     0   10M   0% /dev
tmpfs                                        55M   92K   55M   1% /run
/dev/mapper/jatare--web--front_system-root  9.3G  2.5G  6.5G  28% /
tmpfs                                       5.0M     0  5.0M   0% /run/lock
tmpfs                                       109M     0  109M   0% /run/shm
/dev/xvda1                                  134M   18M  109M  15% /boot

My MongoDB-files store at /var/lib/mongodb/, and there are a lot of enough space to store data.

Then I've just restarted mongodb service and apache2 service and now everything works well. But i am afraid of getting the same situation in near future.

So my question is what is the problem and how to solve it?

For @NickW:

root@jatare-web-front:~# df -i
Filesystem                                 Inodes IUsed  IFree IUse% Mounted on
rootfs                                     593408 46255 547153    8% /
udev                                        57496   273  57223    1% /dev
tmpfs                                       69353   189  69164    1% /run
/dev/mapper/jatare--web--front_system-root 593408 46255 547153    8% /
tmpfs                                       69353     3  69350    1% /run/lock
tmpfs                                       69353     2  69351    1% /run/shm
/dev/xvda1                                  72720    27  72693    1% /boot
  • What sort of server are you running? Virtualized? – NickW Jan 07 '15 at 14:31
  • It's running in cloud, like Amazon AWS. – Alexander Perechnev Jan 07 '15 at 14:33
  • 1
    `posix_fallocate` basically tries to find out if the entire size of the file is available on disk. Mongodb creates quite large files on disk, it's possible it was over 6.5 GB.. so, put more disk space in there if you want to avoid the issue. – NickW Jan 07 '15 at 14:42
  • 1
    Have you checked the number of inodes avaialable? ```df -i```. – Chris Davidson Jan 07 '15 at 15:28
  • @Dayvo I've added result of `df -i` to my question. – Alexander Perechnev Jan 07 '15 at 21:35
  • Wow i've found that MongoDB can't store more than 2GB on x32-machines. Maybe this is the problem... – Alexander Perechnev Jan 07 '15 at 21:40
  • The second thing is that result of `ls -lah` is different to real size. I mean, first I typed `cd /var/lib/`, then typed `ls -lah mongodb/` and summary size of all files is about 500MB. But then i typed `tar -cvf mongodb.tar mongodb/` and size of mongodb.tar was about 1.2GB. I really don't understand how is it possible, but it is. – Alexander Perechnev Jan 08 '15 at 13:42

1 Answers1

1

The only solution I've found is about 2GB-limitations in MongoDB on x32-machines. MongoDB can't store more than 2GB on x32-operation systems: http://blog.mongodb.org/post/137788967/32-bit-limitations

But I'm not sure that that was the problem.