M
M
mitaichik2015-10-19 13:51:48
MongoDB
mitaichik, 2015-10-19 13:51:48

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)

Question: Is it possible to clear the place in another way? I understand that db.repairDatabase() does not work due to insufficient space, but I don't have any more.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lega, 2015-10-19
@mitaichik

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.

P
Puma Thailand, 2015-10-19
@opium

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 question

Ask a Question

731 491 924 answers to any question