Before you can configure an AlwaysOn
Availability Group, there are a few prerequisites. First, the servers
that host the SQL Server instance must be clustered together. Instead
of using a witness server as with the database mirroring feature,
AlwaysOn Availability Groups leverage the internode health and failure
detection capabilities native within Windows Server failover cluster
feature. One significant difference between setting up failover
clustering for AlwaysOn Availability Groups and for a failover cluster
is that AlwaysOn Availability Groups have no requirement of a shared
disk. Thus, the setup involved with creating a cluster of Windows
Servers is simple.
In the example to follow, we have four servers. The first is called DENALI-DC
and it’s a domain controller of the consoto.lab domain. The second, third, and fourth are SQL-EAST
, SQL-WEST
, and SQL-SOUTH
respectively. Our objective is to create an Availability Group of three databases, DatabaseA
, DatabaseB
, and DatabaseC
with SQL-WEST
as the primary role availability replica and SQL-EAST
and SQL-SOUTH
as a secondary role availability replicas.
There is a domain user called CONTOSO\SQLService
. The SQL Server instances for all three SQL Server servers are using this domain account for their SQL Server service account.
1. Creating a Windows Server Failover Cluster
The first step is creating a Windows Server failover cluster group with SQL-EAST
, SQL-SOUTH
, and SQL-WEST
.
This step doesn’t have anything to do with the SQL Server instance;
rather we are creating the Windows Server failover group containing
these three Windows servers.
To create a Windows server failover cluster,
each Windows server needs to have the Failover Cluster role installed.
You can install this via the Server Manager. Once this is role is
installed, you can create a cluster by using the Create a Cluster
wizard. This wizard can be launched in Server Manager by selecting
Failover Cluster Manager under the Server Manager node and then
clicking Create a Cluster hyperlink in the Actions pane.
The second page in the wizard is the Select
Servers page. On this page, we add all the servers that are to be a
part of this cluster—in our example, SQL-EAST
, SQL-SOUTH
, and SQL-WEST
. This page is shown in Figure 1.
Figure 1. Select Server page in the Create Cluster Wizard
The next page in the wizard asks you about
validating the cluster. Prior to Windows Server 2008, if you wanted to
set up a failover cluster, you had to run it on specific hardware. All
that changed, and you can set up a cluster on almost any hardware. You
can skip this validation test and choose No.
A virtual IP is created for administering the cluster. This next page asks you for this virtual name and is shown in the Figure 2.
Figure 2. Access point for cluster administration
After the confirmation page, the wizard forms the cluster. Upon successful completion, the Summary shown in Figure 3 is displayed.
Figure 3. Successful cluster failover page