This version of the documentation is archived and no longer supported.

Migrate Config Servers with the Same Hostname


This procedure applies to migrating config servers when using three mirrored mongod instances as config servers.

Starting in MongoDB 3.2, config servers can be deployed as replica set. MongoDB 3.2 deprecates the use of three mirrored mongod instances for config servers.

For replacing config servers deployed as members of a replica set, see Replace a Config Server.

For a sharded cluster that uses 3 mirrored config servers, use the following procedure migrates a config server to a new system that uses the same hostname.

To migrate all three mirrored config servers, 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.

  1. Shut down the config server.

    This renders all config data for the sharded cluster “read only.”

  2. 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.

  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, you might issue a command similar to the following:

    rsync -az /data/configdb/
  4. Start the config server instance on the new system. The default invocation is:

    mongod --configsvr

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.