Sql server 2012 ha dr 24_hop_final
-
Upload
jdanton -
Category
Technology
-
view
1.761 -
download
2
description
Transcript of Sql server 2012 ha dr 24_hop_final
![Page 1: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/1.jpg)
SQL Server 2012High Availability and DRJoey D’Antoni
SQL Saturday #118 Madison, WI
21 April 2011
![Page 2: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/2.jpg)
About Me
• @jdanton on Twitter• Principal Architect SQL Server, Comcast Cable• Joedantoni.wordpress.com• Videos and Blogs at SSWUG.org• Vice President of the Philadelphia SQL Server User
Group– SQL Saturday #121 Philadelphia—June 9th
![Page 3: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/3.jpg)
Agenda
• SQL Server 2008 to 2012—What’s Changed in HA and DR
• Geo-Clustering• All about Availability Groups
![Page 4: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/4.jpg)
Learning Objectives
• SQL Server HA and DR • What’s involved in SQL Clustering• How clustering and Availability Groups work• What’s new in 2012 HA/DR
![Page 5: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/5.jpg)
Licensing (What’s New)
• The Availability Group features will require the Enterprise Edition of SQL Server
• The licensing model for SQL Enterprise Edition has changed. Consult your friendly Microsoft sales representative for more details
• AlwaysOn read-only replicas will need to be licensed
![Page 6: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/6.jpg)
Windows Core Support
• No GUI version of Windows• Allows for fewer patches• Uses PowerShell and MMCs for support
![Page 7: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/7.jpg)
Windows Core
![Page 8: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/8.jpg)
High Availability (HA) and Disaster Recovery (DR) Options in SQL 2008
• Backup and Recovery• Failover Cluster Instances (FCI)• Mirroring• Log Shipping• Replication• SAN Replication*• Virtualization*
![Page 9: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/9.jpg)
High Availability (HA) and Disaster Recovery (DR) Options in SQL Server 2012
• Backup and Recovery• Failover Cluster Instances (FCI)• Mirroring
• Availability Groups (2012)• Log Shipping• Replication• SAN Replication*• Virtualization*
![Page 10: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/10.jpg)
What’s new in SQL Server 2012 HA/DR
• AlwaysOn Availability Groups• SMB Support for Failover Cluster Instances• Multi-subnet clustering is supported• Flexible Failover
![Page 11: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/11.jpg)
SQL Server Failover Clustering Architecture
![Page 12: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/12.jpg)
SQL Failover Clustering in 2008
• SQL Clustering required 1 subnet to be used across the whole cluster
• Cluster failover is controlled by isAlive/looksAlive processes, which check the SQL service and run @@servername
![Page 13: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/13.jpg)
SQL Failover Clustering in 2012
• Full support for geo-distributed clusters• SMB Storage (File Shares) Supported for FCI• Flexible failover model based on sp_server_diagnostics• TempDB on Non-shared Disk Resource
– Makes PCI-based Solid State Drive an option
![Page 14: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/14.jpg)
Quorum
It’s not just bad cologne anymore
![Page 15: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/15.jpg)
QuorumAre you there?
Why Yes I am here
![Page 16: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/16.jpg)
Understanding Quorum
• There are a several slides on this topic—it is critical!– In a nutshell, you cluster has to be able to talk to itself to keep the
cluster service up in running– This applies to both SQL Server Failover Cluster Instances and
AlwaysOn Availability Groups
![Page 17: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/17.jpg)
Quorum
• Quorum is critical—contains master copy of the cluster’s configuration
• Serves as a tiebreaker if network communications between cluster nodes fail
• If Quorum fails—cluster is shut down until it’s restored
![Page 18: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/18.jpg)
Quorum Models
• Node and Disk Majority (Default)• Node Majority• No Majority (Quorum Disk Only)• Node and File Share Majority (Good for Geo Clusters)
![Page 19: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/19.jpg)
Quorum Failure Tolerance
Number of Nodes 2 3 4 5 6 7
Node Majority 0 1 1 2 2 3
Node and Disk/File Share Majority 1 2 2 3 3 4
• Assuming Disk is Up Calculation is: Cluster Up = RoundUp(Total # of Nodes/2)
• Assuming Disk is Down Calculation is: ClusterUp = RoundUp (Total # of Nodes/2)-1
![Page 20: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/20.jpg)
Why Do Clusters Failover?
• Initiated by failures in hardware or software
• Checked by isAlive/LooksAlive processes (in 2008R2 and below)
![Page 21: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/21.jpg)
Flexible Failover—New for 2012
• Replaces looksAlive/isAlive functionality in SQL Clusters (and is used for Availability Groups)
• Now runs sp_server_diagnostics– Accepts two parameter
• HealthCheckTimeout (Default 60 sec/Minimum 15 sec)• Failover Condition Level
![Page 22: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/22.jpg)
Flexible Failover Policies for Clusters
Level Condition Description
0 No automatic failover or restart
• Indicates that no failover or restart will be triggered automatically on any failure conditions.
1 Failover or restart on server down • SQL Server service is down.
2Failover or restart on server unresponsive
• SQL Server instance is not responsive (Resource DLL cannot receive data from sp_server_diagnostics within the HealthCheckTimeout settings).
3 (Default)Failover or restart on critical server errors
• System stored procedure sp_server_diagnostics returns ‘system error’. (Critical errors > 20)
4Failover or restart on moderate server errors
• System stored procedure sp_server_diagnostics returns ‘resource error’. (Moderate errors > 17)
5Failover or restart on any qualified failure conditions
• System stored procedure sp_server_diagnostics returns ‘query_processing error’. (Deadlock)
![Page 23: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/23.jpg)
What is Stretch Clustering
• Also known as Geo-Clustering
![Page 24: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/24.jpg)
Geo Cluster
![Page 25: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/25.jpg)
Geo-Distributed Clustering
• Requires SAN replication ($$$$)• Two of everything• Requires really fast network connection• Requires some trickery at the network/DNS level for
connectivity• Witness Disk (Quorum)
– Can be physical (SAN) disk, or cluster file share
![Page 26: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/26.jpg)
Geo-distributed Failover Clustering
• Was available in SQL 2008, but easier to implement in 2012
• Won’t be used by most organizations due to cost and complexity
![Page 27: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/27.jpg)
Review—DR Options in SQL 2008
• Mirroring– Allowed automatic failover, but only one target– Mirror target is unreadable
• Log Shipping– Allowed multiple targets, but failover a manual process, requiring a
connection string change
• Replication
![Page 28: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/28.jpg)
AlwaysOn Availability Groups
![Page 29: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/29.jpg)
AlwaysOn Requirements
• Windows Enterprise (Clustering is a requirement)• SQL Server Enterprise Edition• Windows Cluster• No shared storage is required• Quorum Disk (File Share if multi-site or local storage)
![Page 30: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/30.jpg)
SQL Server Failover Clustering Architecture--Review
![Page 31: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/31.jpg)
AlwaysOn Architecture
![Page 32: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/32.jpg)
Flexible AG Failover
• Similar to how a failover clustered instance fails over• Connects to instance every 30 seconds to perform health
check• Also, similar quorum model to Windows Failover
Clustering
![Page 33: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/33.jpg)
AlwaysOn Architecture-Advanced
![Page 34: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/34.jpg)
Allows for SAN-Less HA/DR
• This is not a huge thing for SQL Server in larger organizations, but big win for medium sized businesses
• Allows much easier native SQL DR in Virtual Environments
![Page 35: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/35.jpg)
Considerations for Availability Groups
• All SQL servers (including the secondary in the DR site) in the same Windows domain
• All the databases must be in FULL recovery model
• The unit of failover (for local HA, as well as DR) is at the AG level, i.e., group of databases – not the instance
![Page 36: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/36.jpg)
Failover Scenarios
Asynchronous-commit mode
Synchronous-commit mode with manual-failover mode
Synchronous-commit mode with automatic-failover mode
Automatic failover No No Yes
Manual failover No Yes Yes
Forced failover Yes Yes No
![Page 37: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/37.jpg)
Read Only Replicas
• Can have up to 4 (1 synch, 3 asynch)• SQL Client 2012 will allow for this routing specifically• Can take backups from read-only copies*
– Copy Only Backups (only full copy, does not affect primary log)– Can backup primary log from replica
• Indexing must be same on replicas• Bad queries can affect status of replica
![Page 38: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/38.jpg)
Read-only vs Read Intent
• Read only replica databases are open to any client that can connect to SQL Server
• Read Intent routing is used for the Application Intent functionality in the SQL 2012 client
• Read intent routing automatically directs connections to either the primary or listener to a secondary replica
![Page 39: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/39.jpg)
Client Connections
![Page 40: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/40.jpg)
Client Connections in This Model
• Availability Group Listener– Works just like a failover clustering instance (single instance,
single IP)– Creates a VCO (AD Virtual Computer Object)—similar to a cluster
virtual object
• Read-only Connections– Requires 2012 native ODBC client
![Page 41: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/41.jpg)
Backups
• You can determine whether the current replica is the preferred backup replica by calling the sys.fn_hadr_backup_is_preferred_replica function
• This checks for replica status• Allows for post-failover backup jobs to run unchanged in
the event of a failure• Logic is:
If (top-priority replica is local) Run backup job
Else Exit with success
![Page 42: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/42.jpg)
Client Connections
• Always specify Multi-Subnet Failover=True in listener connection
• From Books Online
“will significantly reduce failover time for single and multi-subnet AlwaysOn topologies.”
• SQL Server Failover Cluster Instances as well
![Page 43: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/43.jpg)
SQL Clusters and Always On
• SQL Failover Clusters can be members of an Availability Group
• FCI can only be configured for manual failover• Only one (the active) node can own the Always On
Replica
![Page 44: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/44.jpg)
Differences—SQL FCI and Availability Groups
![Page 45: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/45.jpg)
Turning On AlwaysOn
![Page 46: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/46.jpg)
Availability Groups Demo
![Page 47: Sql server 2012 ha dr 24_hop_final](https://reader031.fdocuments.in/reader031/viewer/2022020306/54b6d50c4a7959ec3a8b4626/html5/thumbnails/47.jpg)
Summary
• Lots of Change in the HA/DR Space• Licensing also changes—talk to your MS rep• SQL Server Failover Clusters still a good HA option• AlwaysOn Availability Groups add a lot more flexibility to
DR