Always On replica prefered FailOver Order

Copper Contributor

Is there way to set the fail over preference of the nodes in Always ON? 

Example: Say I have a 4 node Always On Availability Group. Node 1A and Node 2A are in one data center and Node 1B and Node 2B are in another. I would like to set it so if Node 1A is the primary and fails it goes to 1B first then to 2A and 2B. Can this be done in SQL 2016 or SQL 2019?

1 Reply
There is a limitation that only 3 nodes can be configured for automatic failover.
Hopefully the links below are helpful.
The topic of the link below is automatic failback, but it presents the failover side as well.
https://charbelnemnom.com/automate-failback-for-sql-alwayson-availability-group/

This link contains some helpful information on configuring AO failovers.
https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/configure-flexible-...