I just deployed application to OpenShift, and it worked fine, until I ment to push changes. Then it started to warn me about disk quota exceeded, and I\'m not able to do any
MongoDB preallocates data files and may preallocate journal files.
If your database is empty and/or you don't care about the data, try stopping mongod and then blowing away your data directory. Then verify/set the following mongod options:
smallfiles=true
noprealloc=true
Something that also helped me was to disable journaling
Laying out complete steps
SSH into your OpenShift
rhc ssh $@ -a $app
In the MongoDB configuration
vim ~/mongodb/conf/mongodb.conf
add or set
nojournal = true
Note: ~
automatically resolves to /var/lib/openshift/<YOUR_OPENSHIFT_ID>
Delete previous journal data
rm ~/mongodb/data/journal/*
Then exit from SSH, and
restart MongoDB
rhc cartridge-restart mongodb-2.4 -a $app
This of course, comes at the cost of not journaling, which is helpful for recovering the data in case of corruption or unclean shutdown. But if you're just testing things out and running out of space then disabling journaling can be very helpful as it takes a lot of space.
If you're hitting the disk quota that's either because you hit the size or inode limit.
To fix the size you can clean up tmp folders, app logs, git repos etc. You can use:
rhc app-tidy -a <appname>
To check if you're hitting the inode limit use quota
command:
quota -s
To fix the quota issue, you will need to keep number of files to a minimum.
If that doesn't help and you can try to shutdown the MongoDB and delete the contents of mongodb
folder (i.e. use helmy's advice).
I have the same problem. Login into your mongodb and run:
db.repairDatabase()
See more at: MongoDB - file size is huge and growing