- Sharding >
- Sharded Cluster Tutorials >
- Sharded Cluster Maintenance Tutorials >
- Replace a Config Server
Replace a Config Server¶
On this page
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¶
Disable the cluster balancer process temporarily. See Disable the Balancer for more information.
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.
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:Update DNS and/or networking so that new config server is accessible by the sane name as the previous config server.
Start the new config server. The default invocation is:
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.