Presentation is loading. Please wait.

Presentation is loading. Please wait.

Roger Technology Solution Professional DataPlatform Microsoft Corporation SQL Server 2012AlwaysOn Availability Groups.

Similar presentations


Presentation on theme: "Roger Technology Solution Professional DataPlatform Microsoft Corporation SQL Server 2012AlwaysOn Availability Groups."— Presentation transcript:

1 Roger Breu@rogerbreu Technology Solution Professional DataPlatform Microsoft Corporation SQL Server 2012AlwaysOn Availability Groups

2 What is an Availability Group? Availability Group Setup Step by Step Active Secondaries Tuning and Monitoring Q&A Agenda

3 SQL Server 2012 AlwaysOn Availability Groups What is an Availability Group?

4 HA/DR Features before Failover Clustering Virtual Networkname (transparent) Multidatabase failoverShared storage neededNo active secondaries available DR only with Storage Replication or additional Logshipping/ Database Mirroring Database Mirroring Fast FailoverNo Shared Storage needed Application has to be “mirroring-aware” (SNAC or connectstring modification) No virtual network name to connect Only 1 active secondary with database snapshots on the mirror Log Shipping Multiple SecondariesNo Shared Storage neededNeeds good monitoringNo automatic failover Secondaries offline while applying transactionlog backups

5 AlwaysOn Availability Groups is a new feature that enhances and combines failover cluster, database mirroring and log shipping capabilities AlwaysOn Availability Groups Multi-database failover Multiple secondaries Total of 4 secondaries 2 synchronous secondaries 1 automatic failover pair Synchronous and asynchronous data movement Built in compression and encryption Flexible failover policy Automatic Page Repair Application failover using virtual name Configuration Wizard Dashboard System Center Integration Rich diagnostic infrastructure File-stream replication Replication publisher failover Flexible Active Secondary Readable Secondary Backup from Secondary Automation using power-shell

6 Availability Group Scenarios Synchronous Data Movement Asynchcronous Data Movement AGAG AGAG AGAG AGAG AGAG Direct Attached Storage local, regional and geo secondaries Example Primary in Calgary Failover Partner in Vancouver Sync DR in Toronto Async Secondary in Montreal (Reporting) Async Secondary in London (Geo DR)

7 Availability Group Scenarios Synchronous Data Movement Asynchcronous Data Movement Shared Storage local, regional and geo secondaries mixed with Direct Attached Storage Example Primary Failover Cluster in Calgary Sync Secondary Failover Cluster in Vancouver AGAG AGAG Async DR Standalone Server in Toronto AGAG

8 «Container» 1 or more Databases Listener (aka virtual networkname) 1 or more IP Addresses (DHCP or fix, aka virtual IP) Replica Definition Primary/Secondaries Automatic Failover Partner Sync/Async Secondaries The Availability Group DB AGAG AG_VNN AG_IP

9 Availability Group Architecture Availability Group uses Windows Server Failover Cluster (WSFC) for Inter-node health detection Failover coordination Primary health detection Distributed data store for Availability Group settings and state Distributed change notifications Windows Server Failover Cluster Database Active Log Synchronization Database Active Log Synchronization SQL Server synchronizes databases Based on Transaction Log Via TCP Endpoint Synchronous or asynchronous Compressed Logstream Encrypted Logstrem DB AGAG AG_VNN AG_IP

10 SQL Server 2012 AlwaysOn Availability Groups Availability Group Setup Step by Step

11 Windows Server 2008/2008 R2 Failover Cluster Feature installed Windows Server Failover Cluster created Needs Cluster Networkname and IP Address No Shared Storage needed Quorum can be configured with Fileshare Witness OS Requirements

12 SQL Server 2012 Installed as Standalone (or SQL Server Failover Cluster*) Instance on every Windows Server Failover Cluster Node Can be named or default instance Instance names don’t have to be the same All Nodes have to be part of the same Windows Server Failover Cluster All Instances must use the same collation Domain Service Account AlwaysOn Availability Groups feature enabled via SQL Server Service Configuration Manager SQL Server Requirements

13 Each availability group name must be unique on the WSFC cluster For a given availability group, the availability replicas must be hosted by server instances running on different nodes of the same WSFC cluster # of availability groups on a given server instance is unlimited Recommended maximum is ten availability groups per instance # of database in a given availability group is unlimited Recommended maximum is 100 databases per availability group Availability Group Requirements

14 Must be a user database System databases cannot belong to an availability group Must be a read-write database Read-only databases cannot be added to an availability group Must be a multi-user database Not use AUTO_CLOSE Use the full recovery model Possess a full database backup Reside on the SQL Server instance where you are creating the availability group and be accessible to the server instance Not belong to another availability group Not be configured for database mirroring Database Requirements

15 Setup Windows Server Failover Cluster Nodes Configure WSFC Setup SQL Server Instances Same collation Recommended to configure same DB/Tlog File pathes Enable AlwaysOn Availability Groups via SQL Server Service Configuration Manager Instance restart needed Start deploying Availability Groups Checklist

16 Application reconnects using a virtual name (listener) after a failover to a secondary PrimarySecondary -server Techdays1 Application retry during failover Connect to new primary once failover is complete and the listener is online Primary Secondary CALGARY VANCOUVER TORONTO Demo Scenario – Application Failover DB1 DB2 DB1 DB2 DB1 DB2 Techdays AG1 Techdays1 (VNN) AG_IP WSFC DENALIWINCLU1

17 Via SQL Server Management Studio Expand the Management node, the AlwaysOn High Availability node, and the Availability Groups node. Right-click the availability group to be failed over, and select the Failover command. Via T-SQL ALTER AVAILABILITY GROUP TechdaysAG1 FORCE_FAILOVER_ALLOW_DATA_LOSS; Via PowerShell Switch-SqlAvailabilityGroup -Path SQLSERVER:\SQL\secondarymachine\secondaryinstance\Availab ilityGroups\TechdaysAG1 -AllowDataLoss Via Failover Cluster Manager Initiate a failover

18 WSFC Service SQL Server Instance AG Res DLL WSFC Service SQL Server Instance AG Res DLL WSFC Service SQL Server Instance AG Res DLL Availability Group 1 Availability Group 2 User tells SQL to failover Availability Group 2 to Node1 SQL confirms and tells WSFC WSFC tells AG Res DLL to bring AG2 offline WSFC tells AG Res DLL to bring AG2 online Notification of new primary Secondaries request primary connection Clients disconnected from AG2 Client connections transparently redirected to primary via IP and network name resources Availability Group Architecture Drilldown

19 Introducing Contained Databases or CDB’s Unit of application programmability in Denali A DB which establishes a boundary between application and server CDBs sever the user–login relationship Windows users no longer need matching logins Users with passwords replace SQL logins What about Server Objects? CDB can be part of an availability group and can failover across replicas Authentication information moves with the CDB Limitation Other objects, like jobs are not contained and have to be managed

20 SQL Server 2012 AlwaysOn Availability Groups Active Secondaries

21 AlwaysOn Active Secondary IT efficiency and cost- effectiveness is critical for businesses Idle hardware is not an option anymore AlwaysOn Active Secondary enables efficient utilization of high availability hardware resources thereby improving overall IT efficiency Active Secondary can be utilized for Balancing read-only workloads Offloading Backup Operations

22 Read-Only client connection behavior determined by Availability Replica Option+ ApplicationIntent Property ApplicationIntent is a connection property Replica option determines whether a replica is enabled for read access when in a secondary role Read-Only Routing enables redirection of client connection to new secondary on role change Enable seamless redirection of application connection across replicas without manual intervention Configuration with Read-Only Routing Lists Read-Only Client Connectivity

23 Readable secondary allows offloading read queries to secondary Automatic redirect with Routing Lists or manual connect to Secondary PrimarySecondary -server Techdays1 Application retry during failover Connect to new primary/new secondary once failover is complete and the listener is online Primary Secondary CALGARY VANCOUVER TORONTO Demo Scenario – Active Secondary DB1 DB2 DB1 DB2 DB1 DB2 Techdays AG1 Techdays1 (VNN) AG_IP Reports -server Techdays1; ApplicationIntent=ReadOnly WSFC DENALIWINCLU1

24 DB1 Data Log Cache Close to real-time reads Log is first hardened and then applied Redo thread is asynchronous and runs in the background Latency (typically seconds) can be larger for log intensive operations like bulk import or index create/rebuild Sync Replica minimizes latency due to network issues DB1 DB1 Log DB1 PrimarySecondary Log Capture Log Recieve DB1 Data Network Redo Thread Redo Pages DB1 Log Page Updated Log Harden Log Flush Commit Acknowledge Commit Log Pool

25 Backups can be done on any replica of a database (Full WITH COPY_ONLY or Tlog) Backups on primary replica still works Log backups done on all replicas form a single log chain Database Recovery Advisor makes restores simple Enabling Backup On Secondary R/W workload Primary Backups Secondary Backups Secondary Backups

26 SQL Server 2012 AlwaysOn Availability Groups Tuning and Monitoring

27 All the availability replicas should run on comparable systems that can handle identical workloads For best performance, use a dedicated network adapter for AlwaysOn Availability Groups (LogStream) Every computer on which a server instance hosts an availability replica must possess sufficient disk space for all the databases in the availability group Keep in mind that as primary databases grow, their corresponding secondary databases grow the same amount For the New Availability Group wizard to automatically start initial data synchronization, every secondary database must use the same file path as its corresponding primary database If you add a file to a primary database, secondary replica(s) will be able to add the new file on the corresponding secondary database(s) Fine Tuning/Tipps

28 Make sure, WSFC network name has „add workstation to domain“ rights otherwise it will only add up to 10 VNNs Failover Cluster Failure Threshold should be adjusted for Test-runs In the Failover Cluster Management snap-in navigation pane, expand one of the managed clusters that has a highly available application or service configured. Expand the Services and Applications category. Select and then right-click one of the groups, and then click Properties. Click the Failover tab, and then view the Maximum failures in the specified period setting TraceFlag 9532 needed for all SQL Server 2012 CTP3 instances to allow more than one replica Configuration via SQL Server Configuration Manager on every node Add T9532 on the startup tab Won’t be necessary with RTM Bits Fine Tuning/Tipps

29 Please consult following KB article for configuration and download Hotfix http://support.microsoft.com/kb/2494036/en-us http://msdn.microsoft.com/en- us/library/hh270279(v=SQL.110).aspx Cluster.exe DENALIWINCLU1 node TORONTO /prop NodeWeight=0 Remove the DR side vote so that a network interruption doesn’t affect the servers running on the main site for HA Node weight Quorum Settings

30 WSFC Service SQL Server Failover Cluster Instance AG Res DLL IsAlive /LooksAlive WSFC asks Res DLL if SQL AG alive exec sp_server_diagnostics Diagnostics generated for Health State Components System Resource Query Processing IO Subsystem Events Diagnostics generated for Health State Components System Resource Query Processing IO Subsystem Events Diagnostics User sets new Cluster properties HealthCheckTimeout and FailureConditionLevel IsAlive/ LooksAlive result based on diagnostics and FailureConditionLevel FailureConditionLevel (0 to 5) 5 – Failover or restart on any qualified failure 4 – Failover or restart on moderate SQL Server errors 3 – Failover or restart on critical SQL Server errors 2 – Failover or restart on SQL Server unresponsive 1 – Failover or restart on SQL Server down 0 – No Automatic Failover or restart Flexible Failover Policy

31 Availability Group Dashboard in Management Studio Monitoring will be fully integrated into the SQL Server 2012 Management Pack for SCOM Including Database Mirroring Monitoring and Replication Monitoring for SQL Server 2008 R2 Lots of new DMVs: http://msdn.microsoft.com/en- us/library/ff878305(v=SQL.110).aspx Availability Group Monitoring

32 Virtualization provides best consolidation isolation Virtualization without AlwaysOn: Simplest management story for limited HA/DR: When to use AlwaysOn for the guest: Need better HA/DR protection than standalone VM Virtualization with AlwaysOn PlannedUnplanned HostLive MigrationVM failover (OS restart, Quick Migration) GuestDowntime during patchNo protection from virtualization

33 SQL Server 2012 AlwaysOn Availability Groups Conclusion

34 SQL Server AlwaysOn Availability Groups is a comprehensive high availability and disaster recovery solution Integrated Flexible Cost-Efficient «Classical» Failover Clustering, Database Mirroring and Log Shipping are not dead A combination of all solutions can bring you to meet your SLAs Conclusion

35 SQL Server 2012 AlwaysOn Availability Groups Additional Resources

36 SQL Server 2012 Developer Training Kit http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27721 SQL Server 2012 CTP3 Product Guide http://www.microsoft.com/download/en/details.aspx?id=27069 swissSQL Blog http://blogs.technet.com/swissSQL AlwaysOn Resource Center http://msdn.microsoft.com/en-us/sqlserver/gg490638(en-us,MSDN.10) AlwaysOn Availability Group Prerequisites http://msdn.microsoft.com/en-us/library/ff878487(v=SQL.110).aspx AlwaysOn Availability Groups together with SQL Server Failover Cluster Instance http://msdn.microsoft.com/en-us/library/ff929171(v=SQL.110).aspx Links

37 Please help us make TechDays even better by Evaluating this Session. Thank you! Give us your feedback!

38 © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Roger Technology Solution Professional DataPlatform Microsoft Corporation SQL Server 2012AlwaysOn Availability Groups."

Similar presentations


Ads by Google