OPTIONS

Replace a Config Server

Overview

This procedure replaces an inoperable config server in a sharded cluster. Use this procedure only to replace a config server that has become inoperable (e.g. hardware failure).

This process assumes that the hostname of the instance will not change. If you must change the hostname of the instance, use the procedure to migrate a config server and use a new hostname.

Considerations

In the course of this procedure never remove a config server from the configdb parameter on any of the mongos instances. If you need to change the name of a config server, always make sure that all mongos instances have three config servers specified in the configdb setting at all

Procedure

  1. Disable the cluster balancer process temporarily. See Disable the Balancer for more information.

  2. Provision a new system, with the same hostname as the previous host.

    You will have to ensure that the new system has the same IP address and hostname as the system it’s replacing or you will need to modify the DNS records and wait for them to propagate.

  3. Shut down the one (and only one) config server that you are replacing. Copy all of this host’s dbPath file system tree from the current system to the system that will provide the new config server. This command, issued on the system with the data files, may resemble the following:

    rsync -az /data/configdb mongodb.config2.example.net:/data/configdb
    
  4. Update DNS and/or networking so that new config server is accessible by the sane name as the previous config server.

  5. Start the new config server. The default invocation is:

    mongod --configsvr
    
  6. Re-enable the balancer to allow the cluster to resume normal balancing operations. See the Disable the Balancer section for more information on managing the balancer process.