March 2019
Intermediate to advanced
394 pages
11h 4m
English
If we want to make a backup of an entire sharded cluster, we need to stop the balancer before starting. The reason is that if there are chunks migrating between different shards at the time that we take our snapshot, our database will be in an inconsistent state, having either incomplete or duplicate data chunks that were in flight at the time we took our snapshot.
Backups from an entire sharded cluster will be approximate-in-time. If we need point-in-time precision, we need to stop all of the writes in our database, something that is generally not possible for production systems.
First, we need to disable the balancer by connecting to our mongos through the mongo shell:
> use config> sh.stopBalancer() ...
Read now
Unlock full access