Hi Team, currently I’m running PSA setup where primary is running in one machine and SA running in one more machine, where P is running at priority as 1 and for S set priority as 0.5.
Everything works fins, but as soon as SA machine dies for some reason, suddenly P in machine 1 becomes secondary how do I fix this? I get only 2 system for this feature?
This happens because you are losing a majority of nodes. Currently you have 3 voting members, when the server the the SA goes down you only have 1/3 voting members. In this case the primary becomes a secondary. To solve this you need to spread across 3 machines otherwise this issue will persist.
This doesn’t happen when the primary goes down because you have 2/3 so you have a majority of nodes so your replica set it up and running.
you have to remove the down nodes from that replica set. Otherwise the total num of nodes will not change when they are down, and mongodb will fail to elect a leader.