Automatic Failover

What if primary node dropped and then it recovered by time, can it automatically get back to be primary again using Automatic Failover feature

Hi @sherif_hany1 welcome to the community!

Yes you can do this: Adjust Priority for Replica Set Member

In basic terms, you setup the replica set with the desired node having a higher priority than the rest. When that node went offline, then back online, the other nodes will see that it has higher priority, and will automatically elect that node to be primary. This is automatic; you don’t have to do anything special for this to happen.

However I must point out that it’s best that all replica set nodes are provisioned with identical hardware, since a replica set is mainly designed to give you high availability. That is, it’s best that no single node has a lot more RAM & disk speed compared to the other nodes to act as the “primary”. Note that the secondaries are doing just as much work as the primary in terms of writing, and as designed, they need to be able to take over as the new primary in a moment’s notice.

Best regards
Kevin

1 Like

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