MongoDB Documentation, Release 3.0.4 rs.stepDown() Migrate a Standalone Shard The ideal procedure for migrating a standalone shard is to convert the standalone to a replica set (page 614) and then use the procedure for migrating a replica set shard (page 711). In production clusters, all shards should be replica sets, which provides continued availability during maintenance windows. Migrating a shard as standalone is a multi-step process during which part of the shard may be unavailable. If the shard is the primary shard for a database,the process includes the movePrimary command. While the movePrimary runs, you should stop modifying data in that database. To migrate the standalone shard, use the Remove Shards from an Existing Sharded Cluster (page 719) procedure. To complete the migration, re-enable the balancer to resume chunk migrations (page 685). Connect to one of the cluster’s mongos instances and pass true to the sh.setBalancerState() method: sh.setBalancerState( true ) To check the balancer state, issue the sh.getBalancerState() method. For more information, see Enable the Balancer (page 718). This procedure shuts down the mongod instance of a config server (page 670) in order to create a backup of a sharded cluster’s (page 661) metadata. The cluster’s config servers store all of the cluster’s metadata, most importantly the mapping from chunks to shards . When you perform this procedure, the cluster remains operational $^{17}$. MongoDB Backup Methods (page 184). See also: Backup Cluster Metadata Re-Enable the Balancer 2. Once the primary has stepped down and another member has become PRIMARY (page 655) state. To migrate the stepped-down primary, follow the Migrate a Member of a Replica Set Shard (page 711) procedure You can check the output of rs.status() to confirm the change in status. 1. Disable the cluster balancer process temporarily. See Disable the Balancer (page 717) for more information. 2. Shut down one of the config databases. 3. Create a full copy of the data files (i.e. the path specified by the dbPath option for the config instance.) 4. Restart the original configuration server. 5. Re-enable the balancer to allow the cluster to resume normal balancing operations. See the Disable the Balancer (page 717) section for more information on managing the balancer process. 17 While one of the three config servers is unavailable, the cluster cannot split any chunks nor can it migrate chunks between shards. Your application will be able to write data to the cluster. See Config Servers (page 670) for more information. Chapter 10. Sharding 712