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?


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.

  • Can I show down one config server and one data server in the replication set at the same time?
    – BAE
    Mar 16 '15 at 13:32
  • Yes, you can do this. As noted, if you want to maintain availability in your replica set the normal rules for election apply (i.e. have a majority of nodes available).
    – Stennie
    Mar 16 '15 at 13:34
  • Please note that running a config server and a data bearing node in one instance is discouraged and that shutting down a config server prevents chunk splits and migrations, which might lead to the dreaded, non-movable jumbo chunks. Apr 10 '15 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.