MongoDB Clustering – Shutting Down One Config Server and One Data Server in Shard

clusteringconfigurationmongodbupgrade

I have one mongodb cluster, including 3 config servers, and one shard (3 data servers in this shard). One data server and one config server are on the same machine. Can I shut both of them down to upgrade the cluster without stop the service?

Best Answer

The normal rules of replica set elections apply.

If your shard is backed by a 3-node replica set, then you can have any single node down while still being able to maintain a primary. A strict majority of nodes must be available, so 2/3 in the 3-node example.

If the data-bearing server you are planning to restart happens to be a replica set primary, I would shut it down gracefully with db.shutdownServer() to minimise down time (and make sure there is an eligible secondary whose oplog data is within 10 seconds of the primary). db.shutdownServer() runs the shutdown command against the admin database.