SQL Server Recovery

Adding AlwaysOn Availability Group to Existing Failover Cluster

Andrew Jackson ~ Modified: March 18th, 2023 ~ High Availability ~ 4 Minutes Reading

SQL server failover cluster

Synopsis: A lot of users are asking us about the solution for adding AlwaysOn availability group to the existing failover cluster easily. Now, we did our research & asked our SQL experts. Hence, this article is presented to solve all the problems of users regarding always on cluster SQL server database.

Table of Content

Understanding the Core Concept

AlwaysOn is the latest addition in the list of high availability features hosted by SQL Server. Introduced in the year 2012, AlwaysOn enables the users to create several copies of a highly available database by making use of WSFC or Windows Server Failover Custer. At times, users require implementing Availability Group on a Failover Cluster Instance.

It is to be noted that for doing this, the user does not require to create separate Windows Server Failover Clusters to do so. Moreover, all the nodes for the availability group must be present on a single WSFC and that too within the same Active Directory Domain. In this write-up, we are Adding AlwaysOn Availability Group to Existing Failover Cluster.

How to Setup Availability Group to an Existing Failover Cluster?

In this section, we are going to learn the process with which the users can setup AlwaysOn availability group via two methodologies. The method deals with the process to combine existing Failover Cluster Instance with a standalone or a failover cluster present in the secondary data center.

Methodology 1 for Failover Cluster Instance

When Failover Cluster Is In Primary Date Center & Availability Group on a Failover Cluster in Secondary Data Center

In this scenario, the Failover Cluster Instance (FCI) is located in the primary data center and the availability group is on other FCI. As we can see from the illustration, in the Primary Database CLP_1 & CLP_2 are its nodes. Similarly, in the secondary database, the nodes are represented as CLS_1 and CLS_2.

CLS_1 and CLS_2

Follow the below-mentioned procedure for adding the Availability Group:

  • Add two nodes named CLS_1 & CLS_2 from the secondary data center to the existing WSFC.
  • For both the nodes, configure shared storage.
  • Install FCI instance using New SQL Server Failover Cluster Installation.
  • Join the secondary node to SQL Server FCI ‘by using Add node.
  • On newly installed FCI, enable AlwaysOn availability group.
  • Define the SQL FCI owners.

Methodology 2 for Failover Cluster Instance

When The FCI Is In Primary Data Center & Availability Group Is on a Standalone SQL Instance

As we can see from the illustration, in the Primary Database named as SQL_PV is the FCI instance and the CL_1 & CL_2 are its nodes. These nodes have been joined to the WSFC. We have to setup the standalone SA_1 instance in the AG_1 group.

SA_1 instance in the AG_1 group

Follow the below-mentioned steps to add the standalone instance:

    • Enable AlwaysOn High Availability on existing CL_1 and CL_2 FCI instance.
    • Open SQL Server Configuration Manager.

Select SQL Server Services option and then click on SQL Server option.

Select Properties option.

  • Under the AlwaysOn High Availability tab, click on Enable AlwaysOn High Availability Groups option.

Enable AlwaysOn High Availability Groups

  • Now, click on Start and select Administrative Tools option.
  • Select Server Manager option and click on Features option.
  • From the list of options, check the Failover Clustering option.

check the Failover Clustering option

  • Now, in your primary data center, right click Nodes and select Add Node option.

Add Node

Note: Since, we are adding the SA_1 node to the already present WSFC, we need to have our secondary server or the replica in the same active directory.

  • In the Add Node Wizard, enter the name of the Server and the SA_1 in the selected Server box.

Add Node Wizard

  • Make sure that the SA_1 node is not included in the FCI. For ensuring this, do right click on SQL_PV click Properties and select Preferred Owner option.Make sure that only CL_1 and CL_2 are marked under the Preferred Owner section.

Preferred Owner

  • On the cluster instance of SQL_PV, click on SQL Properties. In the Advanced Policies, under the Possible Owners section, only select CL_1 and CL_2 as a pair. In case SA_1 is not removed as the possible owner, error is encountered during th connection establishment.
  • Now, enable the High Availability on the SA_1 node in the secondary data center.

secondary data center

  • Select Properties option.
  • Under the AlwaysOn High Availability tab, click on Enable AlwaysOn High Availability Groups option.

Now, everything is ready for setting up the AG_1 availability group amidst the two data centers.

Conclusion

With the help of the two procedures mentioned in the write-up, we believe that the users will be able to add AlwaysOn availability group to an existing failover cluster successfully. The process is not as difficult as other SQL server users explain. It’s just that the right technique must be taken into consideration.