Answer the question
In order to leave comments, you need to log in
How to clean up the space occupied by MongoDb?
Gentlemen, I have a Mongo base about 11Gb in size. I cleaned up unnecessary data on 5Gb. I would like the size of the database to decrease accordingly, because there is only 3Gb of disk space left. The manual says that you need to use db.repairDatabase().
Her call fails
Cannot repair database app having size: 10682892288 (bytes) because free disk space is: 3699429376 (bytes)
Answer the question
In order to leave comments, you need to log in
I sketched some thoughts:
In this case, I sometimes raise an instance in Digital Ocean (40 kopecks / hour) in a "couple of minutes", mount it via nfs , do mongodump, delete the database, mongorestore. All. - fast, cheap.
Or just dump/restore from another host (if it exists).
You can also try to make a data dump, the dump may weigh less and if you're lucky, then 3GB is enough.
It also happens that monga keeps deleted temporary files that take up space, you can try to restart monga or the entire server.
You can use the smallfiles flag, then the monga will take up space a little more economically.
You can turn off logging - an additional 3GB will be freed up, then it will be enough for dump / restore, and maybe for repairDatabase.
dump the database to another server, delete the database, upload the database from another server
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question