MongoDB Documentation, Release 3.0.4 Procedure Step 1: Disable the balancer. Disable the balancer process that equalizes the distribution of data among the shards . To disable the balancer, use the sh.stopBalancer() method in the mongo shell. Consider the following example: use config sh.stopBalancer() For more information, see the Disable the Balancer (page 717) procedure. Step 2: If necessary, lock one secondary member of each replica set in each shard. If your mongod does not have journaling enabled or your journal and data files are on different volumes, you must lock your mongod before capturing a back up. If your mongod has journaling enabled and your journal and data files are on the same volume, you may skip this step. If you need to lock the mongod , attempt to lock one secondary member of each replica set in each shard so that your backups reflect the state of your database at the nearest possible approximation of a single moment in time. To lock a secondary, connect through the mongo shell to the secondary member’s mongod instance and issue the db.fsyncLock() method. Step 3: Back up one of the config servers. Backing up a config server (page 670) backs up the sharded cluster’s metadata. You need back up only one config server, as they all hold the same data. Do one of the following to back up one of the config servers: Create a file-system snapshot of the config server. Do this only if the config server has journaling enabled. Use the procedure in Backup and Restore with Filesystem Snapshots (page 243). Never use db.fsyncLock() on config databases. Create a database dump to backup the config server. Issue mongodump against one of the config mongod instances. If you are running MongoDB 2.4 or later with the --configsvr option, then include the --oplog option to ensure that the dump includes a partial oplog containing operations from the duration of the mongodump operation. For example: mongodump --oplog Step 4: Back up the replica set members of the shards that you locked. You may back up the shards in parallel. For each shard, create a snapshot. Use the procedure in Backup and Restore with Filesystem Snapshots (page 243). Step 5: Unlock locked replica set members. If you locked any mongod instances to capture the backup, unlock them now. Unlock all locked replica set members of each shard using the db.fsyncUnlock() method in the mongo shell. Step 6: Enable the balancer. Re-enable the balancer with the sh.setBalancerState() method. Use the following command sequence when connected to the mongos with the mongo shell: 257 5.2. Administration Tutorials