Making Primary in Replica Set

In the 3 Nodes Replica Set, two nodes were shut down. Then the remaining one node will be secondary.
But is there any way to force this node to be primary?

No. To have a primary you need a majority of the nodes from the replica set to elect a primary. If you have less nodes that the majority online, there will be no election.

1 Like

Thank You :frowning: :smiley:

When operating 2 nodes in operation and 1 node in DR, if 2 nodes fail in operation, we are looking for a way to make it serviceable with 1 node in DR for a while.

Is there a way?

Hi @Kim_Hakseon

For this to be automatic you need to run your replicaSet with majority. A 3 node cluster will survive 1 node failure, a 5 node can survive 2. Build the replicaSet to survive the failure modes you want to.

In my experience losing two of three nodes in any replicated system is extremely rare(looking at you IBM Softlayer networking screw-ups).

With your current configuration you can manually force reconfigure your remaining node to a single node replicaset. This brings additional challenges and questions you have to address as when the other two nodes are operation they will form a functional replicaSet. What would your clients connect to next time they open a database connection? So not an approach I’d recommend.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.