1

I originally had a Replica Set comprised of three nodes on different servers. As part of a contingency plan, I tested how long it would take to hot-swap from using a replica set to only using one node, in case one of our data servers went offline.

I followed the steps listed in the Mongo docs here: https://docs.mongodb.com/manual/tutorial/remove-replica-set-member/

I manually removed the others nodes from the cfg.members array and performed a rs.conf() to get the other node working properly. This seemed like the fastest way to restore our application, with writes being possible again after ~7 minutes of downtime.

Now, I'm at the point where I have one node in the replica set, with unsynced writes, and I need to add the other two nodes back. How do I go about adding these two nodes, while maintaining the writes committed during the hot-swap? I can't just execute rs.conf() since I am unable to hold elections in my replica set. I apologize if this question is a duplicate, but I was unable to find any satisfactory answers.

  • 1
    One by one rs.add("hostname:port") at current PRIMARY. – JJussi Jun 6 '18 at 11:31
  • Can u share the current rs.status() output? – JERRY Jun 8 '18 at 8:16

Your Answer

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

Browse other questions tagged or ask your own question.