Migrate Config Servers with the Same Hostname¶
To migrate all the config servers in a cluster, perform this procedure for each config server separately and migrate the config servers in reverse order from how they are listed in the mongos instances’ configdb string. Start with the last config server listed in the configdb string.
Shut down the config server.
This renders all config data for the sharded cluster “read only.”
Change the DNS entry that points to the system that provided the old config server, so that the same hostname points to the new system. How you do this depends on how you organize your DNS and hostname resolution services.
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, you might issue a command similar to the following:
rsync -az /data/configdb/ mongodb.config2.example.net:/data/configdb
Start the config server instance on the new system. The default invocation is:
When you start the third config server, your cluster will become writable and it will be able to create new splits and migrate chunks as needed.