MongoDB Documentation, Release 3.0.4 Migrate Config Servers with Different Hostnames Overview Considerations Procedure Sharded clusters use a group of three config servers to store cluster meta data, and all three config servers must be available to support cluster metadata changes that include chunk splits and migrations. If one of the config servers is unavailable or inoperable, you must replace it as soon as possible. This procedure migrates a config server (page 670) in a sharded cluster (page 667) to a new server that uses a different hostname. Use this procedure only if the config server will not be accessible via the same hostname. If possible, avoid changing the hostname so that you can instead use the procedure to migrate a config server and use the same hostname (page 707). Changing a config server’s (page 670) hostname requires downtime and requires restarting every process in the sharded cluster. While migrating config servers, always make sure that all mongos instances have three config servers specified in the configDB setting at all times. Also ensure that you specify the config servers in the same order for each mongos instance’s configDB setting. 1. Disable the cluster balancer process temporarily. See Disable the Balancer (page 717) for more information. 2. Shut down the config server to migrate. 3. Copy the contents of dbPath from the old config server to the new config server. For example, to copy the contents of dbPath to a machine named mongodb.config2.example.net , use a command that resembles the following: 4. Start the config server instance on the new system. The default invocation is: 5. Shut down all existing MongoDB processes. This includes: • the mongod instances for the shards. • the mongod instances for the existing config databases (page 737). • the mongos instances. 6. Restart all shard mongod instances. 7. Restart the mongod instances for the two existing non-migrated config servers. 8. Update the configDB setting for each mongos instances. 9. Restart the mongos instances. 10. 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. This renders all config data for the sharded cluster “read only.” rsync -az /data/configdb mongodb.config2.example.net:/data/configdb mongod --configsvr Chapter 10. Sharding 708