We have two servers (SQL-ATL01, SQL-ATL02) that make up a Failover Cluster, each running as part of a SQL Server High Availability Group (HAG). Each server has two network cards. One is a 10Gbit card that is directly connected to the other server and is used for Synchronizing the HAG on a 192.168.99.x subnet. The other is a 1Gbit card that is used to connect the DB servers to a switch to communicate with the application servers on a 10.0.0.x subnet. The Listener is pointed to the 192.168.99.x subnet.
We want to add a third server (SQL-NYC01) in another physical location to the cluster and run it as an Async replica part of the HAG, but the VPN only routes traffic on the subnet on the 1Gbit network.
Is there any way to set up the Failover Cluster and High Availability Group to tell it:
Or do we have to have all replica traffic going in and out on the same IP address/subnet?
Up to eight secondary replicas are supported, including one primary replica and four synchronous-commit secondary replicas.
Each database uses up to one-half of the total number of CPU cores, but not more than 16 threads per database. If the total number of required threads for a single instance exceeds 100, SQL Server uses a single redo thread for every remaining database.
An SQL AlwaysOn failover cluster instance provides high availability and disaster recovery at the SQL Server level. AlwaysOn Availability Groups (AAG) provide high availability and disaster recovery at SQL database level.
High Availability (HA) is the solution\process\technology to make the application\database available 24x7 under either planned or un-planned outages. Mainly, there are five options in MS SQL Server to achieve\setup high availability solution for the databases.
Always On Availability Group provides a high availability solution on the group level, where each group can contain any number of databases that can be replicated to multiple secondary servers known as Replicas. SQL Server 2016 supports up to eight replicas.
There is a way to do it, otherwise this would be a major drawback.
Before starting you should create backups and restore DBs so you can use Initial data synchronization type will be only JOIN ONLY
(since you have only 1Gbit node).
join only - is to start synchronization if you already created backups and restored on all secondary replicas
To make my life easier I'll presume some IP addresses which you can easily adapt:
sync node: SQL-ATL01 192.168.99.1
sync node: SQL-ATL02 192.168.99.2
async node: SQL-NYC01 10.0.0.10
SQL-ATL01
) and right click on the sql server service and click on properties - there find a tab AlwaysOn High Availability and check the checbox Enable AlwaysOn Availability Groups (you will see the Windows fail over cluster name above. After changing this property you need to restart the SQL Services. Do that for both other replicas SQL-ATL02
and SQL-NYC01
. SQL-ATL01
(based on its name). Right-click on AlwaysOn High Availability and select the Wizard (the first option). You will the wizard window where you will see the overview what can you do - you can click next button.Now getting to the core (Specify Replicas). Here we will work with tabs Replicas and Listener.
Starting with Replicas you need to add your Replicas (I'm only writing the important/changed columns):
╔═══╦═══════════════════╦═════════════════╦═════════════════════╦══════════════════════╗
║ ║ Server Instance ║ Initial Role ║ Automatic Failover ║ Synchronous commit ║
╠═══╬═══════════════════╬═════════════════╬═════════════════════╬══════════════════════╣
║ 1 ║ SQL-ATL01 ║ Primary ║ Checked ║ Checked ║
║ 2 ║ SQL-ATL02 ║ Secondary ║ Checked ║ Checked ║
║ 3 ║ SQL-NYC01 ║ Secondary ║ Unchecked ║ Unchecked ║
╚═══╩═══════════════════╩═════════════════╩═════════════════════╩══════════════════════╝
If you want SQL-NYC01 to be a failover or sync you have to check the checkboxes here.
SQLAGListener
, select port (default is 1433
) and Network mode -> Static IP
.Now click on button add
where you select your subnets and IP address:
╔═══╦═════════════════╦═════════════════════════════╗
║ ║ Subnet ║ IP Address ║
╠═══╬═════════════════╬═════════════════════════════╣
║ 1 ║ 192.168.99.0/24 ║ 192.168.99.1 192.168.99.2 ║
║ 2 ║ 10.0.0.0/24 ║ 10.0.0.10 ║
╚═══╩═════════════════╩═════════════════════════════╝
Then click next.
Join only
.The options are:
Full - is to start the synchronization after creating and restoring the backups
Join only - is to start synchronization if you already created backups and restored on all secondary replicas
Skip initial data synchronization - this is used if you still need to create a backup and restore to the replicas
SQLAG
, Create Availability Group Listener SQLAGListener
, etc.You should see in your SQL Server Management studio at each node AlwaysOn HA each node of SQLAG (SQL-ATL01 (primary), SQL-ATL02 (secondary), SQL-NYC01 (secondary)).
If you expand it at e.g. SQL-ATL01
you should see all replicas in Availability Replicas and the selected databases in Availability Databases and the configured listener (SQLAGListener) in the Availability Group Listeners.
You could also check the Failover Cluster Manager.
Where you would see the configured listener SQLAGListener: The Primary node 192.168.99.1 will be shown as online and the others as offline.
To see the current status of the nodes you can also right-click on SQLAG(Primary) and show dashboard. This can be done for every node and can be used for testing/viewing the current state if you need to do so.
Edit
You should also test the configuration if you did not miss anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With