Details
-
Bug
-
Resolution: Won't Do
-
Major - P3
-
None
-
*Location*: https://docs.mongodb.com/manual/tutorial/backup-sharded-cluster-with-filesystem-snapshots/
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
*Screen Resolution*: 1440 x 900
Description
The following topic should be added to this page. Lots of people have only stopped the balancer without checking if it still active. Bringing this topic to this page will make the process more accurate and complete:
Disable Balancing During Backups
If MongoDB migrates a chunk during a backup, you can end with an inconsistent snapshot of your sharded cluster. Never run a backup while the balancer is active. To ensure that the balancer is inactive during your backup operation:
Set the balancing window so that the balancer is inactive during the backup. Ensure that the backup can complete while you have the balancer disabled.
manually disable the balancer for the duration of the backup procedure.
If you turn the balancer off while it is in the middle of a balancing round, the shut down is not instantaneous. The balancer completes the chunk move in-progress and then ceases all further balancing rounds.
Before starting a backup operation, confirm that the balancer is not active. You can use the following command to determine if the balancer is active:
!sh.getBalancerState() && !sh.isBalancerRunning()
When the backup procedure is complete you can reactivate the balancer process.