Force a replica to become primary in minority election

I have a mongo cluster with 3 replicas in 2 regions (Europe and US). The primary replica is located in Europe and the secondary replicas are in Europe.

My question is: if both of the replicas from Europe are down how can I force the primary to remain the primary or how can I convert the primary to become primary again even if we have minority in election?

You may remove the 2 down nodes from the replica set. So now you have a 1 node replica set which should become primary.

Hi @Daniel_Ionescu,
Higher-priority members are more likely to call elections, and are more likely to win. Use this setting to ensure that some members are more likely to become primary and that others can never become primary.

to configure priority without Ops you can follow the steps of this link:
Adjust Priority for Replica Set Member — MongoDB Manual
Edit a Replica Set — MongoDB Ops Manager upcoming


@Fabio_Ramohitaj, there will be not election. A minority of nodes are still up. What ever the priority there will be no primary. You need a majority of nodes to elect a primary. No majority implies no primary. The only way to get a primary back is to up one of the node or remove them from the configuration.

1 Like

Hi @steevej ,
you’ re right as always, ty for the explanation!!