I'm building a sharded MongoDB cluster, which I want to manage automatically. To achieve this I build the normal setup of a sharded db with:
- 3 replications of the config db
- 3 replications of shard "a" (initially only one but by growing the node size the number of shards increase)
- 3 replications of the mongodb access points "mongos"
To connect the config db with the mongos instance I used the following command:
mongos --configdb "cfg/<ip_of_config_server_1>:<port_of_config_instance>,cfg/<ip_of_config_server_2>:<port_of_config_instance>,cfg/<ip_of_config_server_3>:<port_of_config_instance>" --fork --logpath <some_path> --port <some_port>
Now my problem is if one of the config servers is removed from the cluster (or goes down) and another is added, I need to update the mongos instance.
I just don't know how to do this without shutting down the mongos instance and rerunning this command, and thus causing downtime.
Does any of you know an approach or best practices for this situation?