Skip to content

Latest commit

 

History

History
129 lines (86 loc) · 15 KB

failover-clustering-and-always-on-availability-groups-sql-server.md

File metadata and controls

129 lines (86 loc) · 15 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords monikerRange
Failover cluster instance with availability groups
Enhance your high availability and disaster recoverability by combining the features of a SQL Server failover cluster instance and an Always On availability group.
MashaMSFT
mathoma
07/02/2017
sql
availability-groups
conceptual
clustering [SQL Server]
Availability Groups [SQL Server], WSFC clusters
Failover Cluster Instances [SQL Server], see failover clustering [SQL Server]
quorum [SQL Server]
failover clustering [SQL Server], AlwaysOn Availability Groups
failover clustering [SQL Server], Always On Availability Groups
Availability Groups [SQL Server], Failover Cluster Instances
>=sql-server-2016

Failover Clustering and Always On Availability Groups (SQL Server)

[!INCLUDEsql windows only]

[!INCLUDEssHADR], the high availability and disaster recovery solution introduced in [!INCLUDEsssql11], requires Windows Server Failover Clustering (WSFC). Also, though [!INCLUDEssHADR] is not dependent upon [!INCLUDEssNoVersion] Failover Clustering, you can use a failover clustering instance (FCI) to host an availability replica for an availability group. It is important to know the role of each clustering technology, and to know what considerations are necessary as you design your [!INCLUDEssHADR] environment.

Note

For information about [!INCLUDEssHADR] concepts, see Overview of Always On Availability Groups (SQL Server).

Windows Server Failover Clustering and Availability Groups

Deploying [!INCLUDEssHADR] requires a Windows Server Failover Cluster (WSFC). To be enabled for [!INCLUDEssHADR], an instance of [!INCLUDEssNoVersion] must reside on a WSFC node, and the WSFC and node must be online. Furthermore, each availability replica of a given availability group must reside on a different node of the same WSFC. The only exception is that while being migrated to another WSFC, an availability group can temporarily straddle two clusters.

[!INCLUDEssHADR] relies on the Windows Server Failover Cluster (WSFC) to monitor and manage the current roles of the availability replicas that belong to a given availability group and to determine how a failover event affects the availability replicas. A WSFC resource group is created for every availability group that you create. The WSFC monitors this resource group to evaluate the health of the primary replica.

The quorum for [!INCLUDEssHADR] is based on all nodes in the WSFC regardless of whether a given cluster node hosts any availability replicas. In contrast to database mirroring, there is no witness role in [!INCLUDEssHADR].

The overall health of a WSFC is determined by the votes of quorum of nodes in the cluster. If the WSFC goes offline because of an unplanned disaster, or due to a persistent hardware or communications failure, manual administrative intervention is required. A Windows Server or WSFC administrator will need to force a quorum and then bring the surviving cluster nodes back online in a non-fault-tolerant configuration.

Important

[!INCLUDEssHADR] registry keys are subkeys of the WSFC. If you delete and re-create a WSFC, you must disable and re-enable the [!INCLUDEssHADR] feature on each instance of [!INCLUDEssNoVersion] that hosted an availability replica on the original WSFC.

For information about running [!INCLUDEssNoVersion] on WSFC nodes and about WSFC quorum, see Windows Server Failover Clustering (WSFC) with SQL Server.

[!INCLUDEssNoVersion] Failover Cluster Instances (FCIs) and Availability Groups

You can set up a second layer of failover at the server-instance level by implementing [!INCLUDEssNoVersion] and FCI together with the WSFC. An availability replica can be hosted by either a standalone instance of [!INCLUDEssNoVersion] or an FCI instance. Only one FCI partner can host a replica for a given availability group. When an availability replica is running on an FCI, the possible owners list for the availability group will contain only the active FCI node.

[!INCLUDEssHADR] does not depend on any form of shared storage. However, if you use a [!INCLUDEssNoVersion] failover cluster instance (FCI) to host one or more availability replicas, each of those FCIs will require shared storage as per standard SQL Server failover cluster instance installation.

For more information about additional prerequisites, see the "Prerequisites and Restrictions for Using a SQL Server Failover Cluster Instance (FCI) to Host an Availability Replica" section of Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server).

Comparison of Failover Cluster Instances and Availability Groups

Regardless of the number of nodes in the FCI, an entire FCI hosts a single replica within an availability group. The following table describes the distinctions in concepts between nodes in an FCI and replicas within an availability group.

Nodes within an FCI Replicas within an availability group
Uses WSFC Yes Yes
Protection level Instance Database
Storage type Shared Non-shared

While the replicas in an availability group do not share storage, a replica that is hosted by an FCI uses a shared storage solution as required by that FCI. The storage solution is shared only by nodes within the FCI and not between replicas of the availability group.
Storage solutions Direct attached, SAN, mount points, SMB Depends on node type
Readable secondaries No* Yes
Applicable failover policy settings WSFC quorum

FCI-specific

Availability group settings**
WSFC quorum

Availability group settings
Failed-over resources Server, instance, and database Database only

*Whereas synchronous secondary replicas in an availability group are always running on their respective [!INCLUDEssNoVersion] instances, secondary nodes in an FCI actually have not started their respective [!INCLUDEssNoVersion] instances and are therefore not readable. In an FCI, a secondary node starts its [!INCLUDEssNoVersion] instance only when the resource group ownership is transferred to it during an FCI failover. However, on the active FCI node, when an FCI-hosted database belongs to an availability group, if the local availability replica is running as a readable secondary replica, the database is readable.

**Failover policy settings for the availability group apply to all replicas, whether it is hosted in a standalone instance or an FCI instance.

Note

For more information about Number of nodes within FCIs and Always On Availability Groups for different editions of [!INCLUDEssNoVersion], see Features Supported by the Editions of SQL Server 2012 (https://go.microsoft.com/fwlink/?linkid=232473).

Considerations for hosting an Availability Replica on an FCI

Important

If you plan to host an availability replica on a SQL Server Failover Cluster Instance (FCI), ensure that the Windows Server 2008 host nodes meet the Always On prerequisites and restrictions for Failover Cluster Instances (FCIs). For more information, see Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server).

[!INCLUDEssNoVersion] Failover Cluster Instances (FCIs) do not support automatic failover by availability groups, so any availability replica that is hosted by an FCI can only be configured for manual failover.

You might need to configure a WSFC to include shared disks that are not available on all nodes. For example, consider a WSFC across two data centers with three nodes. Two of the nodes host a SQL Server failover cluster instance (FCI) in the primary data center and have access to the same shared disks. The third node hosts a stand-alone instance of SQL Server in a different data center and does not have access to the shared disks from the primary data center. This WSFC configuration supports the deployment of an availability group if the FCI hosts the primary replica and the stand-alone instance hosts the secondary replica.

When choosing an FCI to host an availability replica for a given availability group, ensure that an FCI failover could not potentially cause a single WSFC node to attempt to host two availability replicas for the same availability group.

The following example scenario illustrates how this configuration could lead to problems:

You configure a WSFC with two nodes, NODE01 and NODE02. You install a [!INCLUDEssNoVersion] failover cluster instance, fciInstance1, on both NODE01 and NODE02 where NODE01 is the current owner for fciInstance1.
On NODE02, you install another instance of [!INCLUDEssNoVersion], Instance3, which is a stand-alone instance.
On NODE01, you enable fciInstance1 for [!INCLUDEssHADR]. On NODE02, you enable Instance3 for [!INCLUDEssHADR]. Then you set up an availability group for which fciInstance1 hosts the primary replica, and Instance3 hosts the secondary replica.
At some point fciInstance1 becomes unavailable on NODE01, and the WSFC causes a failover of fciInstance1 to NODE02. After the failover, fciInstance1 is a [!INCLUDEssHADR]-enabled instance running under the primary role on NODE02. However, Instance3 now resides on the same WSFC node as fciInstance1. This violates the [!INCLUDEssHADR] constraint.
To correct the problem that this scenario presents, the stand-alone instance, Instance3, must reside on another node in the same WSFC as NODE01 and NODE02.

For more information about [!INCLUDEssNoVersion] FCIs, see Always On Failover Cluster Instances (SQL Server).

Restrictions on Using The WSFC Failover Cluster Manager with Availability Groups

Do not use the Failover Cluster Manager to manipulate availability groups, for example:

  • Do not add or remove resources in the clustered service (resource group) for the availability group.

  • Do not change any availability group properties, such as the possible owners and preferred owners. These properties are set automatically by the availability group.

  • Do not use the Failover Cluster Manager to move availability groups to different nodes or to fail over availability groups. The Failover Cluster Manager is not aware of the synchronization status of the availability replicas, and doing so can lead to extended downtime. You must use [!INCLUDEtsql] or [!INCLUDEssManStudioFull].

Warning

Using the Failover Cluster Manager to move a failover cluster instance hosting an availability group to a node that is already hosting a replica of the same availability group may result in the loss of the availability group replica, preventing it from being brought online on the target node. A single node of a failover cluster cannot host more than one replica for the same availability group. For more information on how this occurs, and how to recover, see the blog Replica unexpectedly dropped in availability group.

Related Content

See Also

Overview of Always On Availability Groups (SQL Server)
Enable and Disable Always On Availability Groups (SQL Server)
Monitor Availability Groups (Transact-SQL)
Always On Failover Cluster Instances (SQL Server)