Question

I have a directory in my local file system where databases are stored called moveChunk which I understand is used by MongoDB for shard movement of chunks. This is taking up around 206GB and I can't find any information on MongoDB site for cleaning this. Some of the data is from earlier in the year. Is there a resource to determine if this is safe to clean? Or is there a process within MongoDB that cleans this?

Was it helpful?

Solution

As per the MongoDB official documentation:

Is it safe to remove old files in the moveChunk directory?

Yes. mongod creates these files as backups during normal shard balancing operations. If some error occurs during a migration, these files may be helpful in recovering documents affected during the migration.

Once the migration has completed successfully and there is no need to recover documents from these files, you may safely delete these files. Or, if you have an existing backup of the database that you can use for recovery, you may also delete these files after migration.

To determine if all migrations are complete, run sh.isBalancerRunning() while connected to a mongos instance.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top