Professional Documents
Culture Documents
Availability Groups
An analysis of Microsoft SQL Server Always-On Availability Group architectures
1
Derik Hammer
@sqlhammer
derik@sqlhammer.com
www.sqlhammer.com
Database Administrator (Traditional/Operational/Production)
Spent a year pretending to be a .NET developer then back to being a DBA
Specialize in High-Availability, Disaster Recovery, and Maintenance Automation
Rebuilt the Hampton Roads SQL Server User Group in Virginia Beach, VA before moving.
Chapter leader of FairfieldPASS in Stamford, CT.
This deck
http://www.sqlhammer.com/presentation-architecting-availability-
groups/
All presentations
http://www.sqlhammer.com/community/
Server Server
Availability Availability
Replica A Replica B
7
Stand-alone instances (cont.)
Availability Availability
Data duplication - a complete
Replica A Replica B set of drives and data per
replica.
Must synchronize server
objects between nodes
manually.
Server Server
Availability Subnet 2
Availability
Replica C Replica D
Server Server
Subnet 1
Availability Availability
Replica A Replica B
10
Stand-alone instances – multi-subnet
(cont.)
• Nodes synchronize from the primary, remote nodes don’t speak to
each other.
11
12
AG with Failover Cluster Instances
Server Server
Subnet
1
Shared Disks
Availability
Replica B
Server Server
Availability
Subnet
Replica A
2
Shared Disks
13
AG with Failover Cluster Instances
(cont.)
No need to synchronize server objects within subnet.
Still need to across the subnets.
Instance level failovers within subnets.
Shared storage can’t cross subnets.
Shared storage dependency.
Can’t ever have one AG replica reside on the same node as another.
Forces you to have more nodes to your cluster.
Configurations where all nodes are active are no longer as possible.
Can’t group DBs for failover, entire instance moves.
14
15
Hybrid Architecture AKA DR on the cheap
Subnet
Subnet 2
1
Availability
Server Server Replica B
Availability
Replica A
Local Disks
16
17
Quorum
Voting mechanism
Prevents “split-brain”
Weight your votes for a complete drop of your connection to your disaster
recovery site
18
Quorum Demo
Dynamic Quorum
Dynamic Witness
Tie breaker
19
Why use the Listener?
Read-only routing.
It is capable of faster failovers.
Your applications do not have to wait for DNS time to live to
expire.
One virtual network name (VNN), regardless of where the Availability
Group (AG) lives.
Configuration files between DR sites can be identical.
21
Listener Demos
SQL Server Management Studio
Persist parameters – Supposedly fixed in vNext as per MS Connect.
http://bit.ly/1wKPucP
Not fixed for SQL Server 2016 RC0
Reference the workarounds -
http://www.sqlhammer.com/store-optional-connection-
parameters-in-sql-server-management-studio/
SQLCMD.exe
SQLPS module’s Invoke-SqlCmd (Not a demo, hard to show the non-
existence of something)
Add MultiSubnetFailover and ApplicationIntent options – Vote up on
MS Connect! http://bit.ly/1BCbB82
22
23
Read-only routing
24
Read-only routing connection flow
Primary Replica
Step 2: Primary replica replies (Includes Listener)
with IP for redirection
Client
Configure - T-SQL
(Non-demo reference) AlwaysOn Tools -
Denny Cherry and Associates -
http://dcac.co/applications/hosted-by-
you/alwayson-tools
26
Back-up Off-loading
27
Monitoring Demo
28
References of interest
Syncing server objects between sites
http://www.sqlhammer.com/synchronizing-server-objects-for-availability-groups/
PowerShell driven desired state Availability Group failover test
http://www.sqlhammer.com/failing-over-alwayson-availability-groups/
SSMS AG Listener connection work around
http://www.sqlhammer.com/store-optional-connection-parameters-in-sql-server-
management-studio/
Lazy log truncation and filestream
http://www.sqlhammer.com/filestream-garbage-collection-with-alwayson-
availability-groups/
Step-by-step work through of the AG + FCI architecture
http://www.sqlhammer.com/how-to-configure-sql-server-2012-alwayson-part-1-of-7/
29
Materials
Slide deck and demo material available at:
This deck
http://www.sqlhammer.com/presentation-architecting-
availability-groups/
All presentations
http://www.sqlhammer.com/community/
My Contact Information:
This material has already been posted.
When I update the material, the most recent updates will be available. @SQLHammer
30 derik@sqlhammer.com
www.sqlhammer.com