This article will show you how to failover an AG to another node and then move the WFC role to the same secondary node.
SQL Server Availability Group Failover Steps
SQL: Moves the AG to another node. This does not make that not the active node in the cluster.
1 2 3 4 5 |
Move-ClusterGroup -Cluster Node1CL -Name AG01US01 -Node Node1 Name OwnerNode State ---- --------- ----- AG01US01 Node1 Online |
Alternately (no pun intended), you can issue this T-SQL to perform the same task on the TARGET node:
1 |
ALTER AVAILABILITY GROUP group_name FAILOVER |
Windows Failover Cluster Failover Steps
WFC: Drains the current node from the role and sends it to the target node. The target node now is the active node. The original node is now paused.
1 2 3 4 5 |
Suspend-ClusterNode -Name Node1 -TargetNode Node2 -Drain -Cluster Node1 CL Name ID State ---- -- ----- Node1 1 Paused |
WFC: Resumes the drained node. It does not make it the active owner of the role.
1 2 3 4 5 |
Resume-ClusterNode -Name Node1 -Failback Immediate -Cluster Node1 CL Name ID State ---- -- ----- Node1 1 Up |
Windows Failover Cluster Failback
These steps will fail back the role to the original node before the failback. Make sure you failback the Availability Group as well with the command at the top of this page
WFC: Drains the current node from the role and sends it to the target node. The target node now is the active node. The original node is now paused.
1 2 3 4 5 |
Suspend-ClusterNode -Name Node2 -TargetNode Node1 -Cluster Node1CL -Drain Name ID State ---- -- ----- Node2 3 Paused |
WFC: Resumes the paused node. This does not make it the active node for the role.
1 2 3 4 5 |
Resume-ClusterNode -Name Node2 -Cluster Node1CL Name ID State ---- -- ----- Node2 3 Up |
REF: Move-ClusterGroup
REF: Suspend-ClusterNode
REF: Resume-ClusterNode
Views – 2126