Presentation is loading. Please wait.

Presentation is loading. Please wait.

AlwaysOn Availability Groups 101

Similar presentations


Presentation on theme: "AlwaysOn Availability Groups 101"— Presentation transcript:

1 AlwaysOn Availability Groups 101
Using SQL Server 2012

2 About Me Jeff Reinhard 20 years database development experience
@jreiny Employment Highlights: Ernst & Young Internet Security Systems/IBM AirWatch WebMD CheckFree 2 | 9/18/2018 | AlwaysOn Availability Groups 101

3 Pyramid Analytics Thank You Microsoft for the facility
For sponsoring tonight’s event: Pyramid Analytics 3 | 9/18/2018 | AlwaysOn Availability Groups 101

4 Agenda What is AlwaysOn Prerequisites Setting Up Monitoring
AlwaysOn and Your Application Lessons Learned Q&A 34 slides, so I need to move fast 4 | 9/18/2018 | AlwaysOn Availability Groups 101

5 Two Types of AlwaysOn ??? AlwaysOn Failover Cluster Instances
leverages Windows Server Failover Clustering (WSFC) functionality to provide local high availability through redundancy at the server-instance level—a failover cluster instance (FCI). Previously known as SQL Clusters Works with SQL Server Standard Edition AlwaysOn Availability Groups (AG) This presentation discusses further Requires SQL Server Enterprise Edition 5 | 9/18/2018 | AlwaysOn Availability Groups 101

6 What Is AlwaysOn AG? AlwaysOn is SQL Servers best available technology for SQL High Availability. AlwaysOn is a new integrated, flexible, cost-efficient high availability and disaster recovery solution. It can provide data and hardware redundancy within and across data centers, and improves application failover time to increase the availability of your mission-critical applications. AlwaysOn provides flexibility in configuration and enables reuse of existing hardware investments. The principal goal of a high availability solution is to minimize or mitigate the impact of downtime. It is recommended for scenarios where high availability is required and the application will benefit from readable copies of the primary databases. 6 | 9/18/2018 | AlwaysOn Availability Groups 101

7 AlwaysOn Architecture Overview
7 | 9/18/2018 | AlwaysOn Availability Groups 101

8 Prerequisites – Before you begin
Prerequisites, Restrictions, and Recommendations for AlwaysOn Availability Groups AlwaysOn Failover Do not use the Failover Cluster Manager to manipulate availability groups, for example: Do not add or remove resources in the clustered service (resource group) for the availability group. Do not change any availability group properties, such as the possible owners and preferred owners. These properties are set automatically by the availability group. Do not use the Failover Cluster Manager to move availability groups to different nodes or to fail over availability groups. The Failover Cluster Manager is not aware of the synchronization status of the availability replicas, and doing so can lead to extended downtime. You must use Transact-SQL or SQL Server Management Studio. 8 | 9/18/2018 | AlwaysOn Availability Groups 101

9 Prerequisites – Before you begin (cont.)
AlwaysOn Quorum Resources Connecting with multi-subnet failover Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server) - Creating a listener Prerequisites and requirements Only one listener can be created though SQL Server.  If you need an additional listener, it can be created thought WSFC. Recommendation, use a static IP for multiple subnet configurations. You must be connected to the instance that hosts that primary replica If using static IP addresses, the listener will have a static IP  for each subnet that has a replica. Configure Read-Only Routing for an AG 9 | 9/18/2018 | AlwaysOn Availability Groups 101

10 Prerequisites - Windows Cluster
Go into Server Manager, features, add features 10 | 9/18/2018 | AlwaysOn Availability Groups 101

11 Prerequisites - Windows Cluster (cont.)
Enable Failover Clustering Make sure cluster services are available on all participating nodes 11 | 9/18/2018 | AlwaysOn Availability Groups 101

12 Prerequisites - Windows Cluster (cont.)
Add the database servers to the cluster Run validations, tests, etc. Some warnings are due to no storage available to the cluster, which is correct for AlwaysOn. Create the cluster Create Active Directory computer account for cluster name 12 | 9/18/2018 | AlwaysOn Availability Groups 101

13 Prerequisites – SQL Server Configuration
Open SQL Server Configuration Manager Select SQL Server Services, right click on SQL Server, select properties 13 | 9/18/2018 | AlwaysOn Availability Groups 101

14 AlwaysOn Set Up 14 | 9/18/2018 | AlwaysOn Availability Groups 101

15 AlwaysOn Setup - Overview
Working Primary Node Available “blank slate” secondary Create Availability Group Select Databases Specify Replicas Create the AG Listener Select full data synchronization Run the wizard Configure Read Only Routing 15 | 9/18/2018 | AlwaysOn Availability Groups 101

16 AlwaysOn Setup - Working Primary Node
Ensure your application is working properly Review logins and users and permissions Using Contained databases is recommended but not required If not using contained databases, export the logins 16 | 9/18/2018 | AlwaysOn Availability Groups 101

17 AlwaysOn Setup - Available “blank slate” secondary
Secondary Node(s) should match the primary in configuration, version, etc. Make sure the databases and files on the primary do not exist on the secondary If not using contained databases, import the logins used by the application. Don’t import default and windows authentication accounts It is vital that the login SIDS match between the primary and secondary node(s) 17 | 9/18/2018 | AlwaysOn Availability Groups 101

18 AlwaysOn Setup - Create Availability Group
Using SSMS, from your primary database node, start the New Availability Group Wizard and give it a name 18 | 9/18/2018 | AlwaysOn Availability Groups 101

19 AlwaysOn Setup - Select Databases
Select all of the databases that work together as a set for your application; possibly including Reporting Services database(s). 19 | 9/18/2018 | AlwaysOn Availability Groups 101

20 AlwaysOn Setup - Specify Replicas
The wizard will select your primary node, add your secondary node(s) 20 | 9/18/2018 | AlwaysOn Availability Groups 101

21 AlwaysOn Setup - Specify Replicas (cont.)
For all, select Synchronous, Automatic Failover, Readable Secondary = Yes 21 | 9/18/2018 | AlwaysOn Availability Groups 101

22 AlwaysOn Setup - Create the AG Listener
On the listener tab, enter name and port 1433, then click add for IP 22 | 9/18/2018 | AlwaysOn Availability Groups 101

23 AlwaysOn Setup - Create the AG Listener (cont.)
Enter the IP address for the listener 23 | 9/18/2018 | AlwaysOn Availability Groups 101

24 Select full data synchronization
Create the folder, preferably on a secondary node, then enter into the wizard 24 | 9/18/2018 | AlwaysOn Availability Groups 101

25 Run the wizard Perform the validation, next, then finish to create the AG 25 | 9/18/2018 | AlwaysOn Availability Groups 101

26 Configure Read Only Routing
I have a script that with the setting of a few variables, will generate the code to perform the configuration. Contact me and provide payment if interested. What is important after configuration Endpoint_url uses DNS name and port 5022 Available mode is synchronous Failover mode is automatic 26 | 9/18/2018 | AlwaysOn Availability Groups 101

27 Configure Read Only Routing (cont.)
What is important after configuration (cont.) Primary role allow connections is ALL Secondary role allow connections is READ_ONLY ReadOnly Routing URL is IP and port 1433 27 | 9/18/2018 | AlwaysOn Availability Groups 101

28 AlwaysOn Monitoring - Dashboard
The first place to start is the dashboard 28 | 9/18/2018 | AlwaysOn Availability Groups 101

29 AlwaysOn Monitoring – Top Section
Look for any errors, warnings, check that failover mode is automatic, AG group state is healthy, check the links on the right for any errors or warnings 29 | 9/18/2018 | AlwaysOn Availability Groups 101

30 AlwaysOn Monitoring - Replicas
Check the health icon, failover mode is automatic, synchronization state is good, and no issues reported 30 | 9/18/2018 | AlwaysOn Availability Groups 101

31 AlwaysOn Monitoring - Databases
Check the primary and secondary, health state, synchronization state, failover readiness, issues 31 | 9/18/2018 | AlwaysOn Availability Groups 101

32 AlwaysOn Monitoring (cont.)
There are many DMV queries that can be used Microsoft SQL Server 2012 AlwaysOn Monitoring Management Pack AlwaysOn Availability Groups Troubleshooting and Monitoring Guide 32 | 9/18/2018 | AlwaysOn Availability Groups 101

33 AlwaysOn and Your Application
The connection strings should all go to the listener, not directly to any database server instance To have your application use the primary mode, no change is required in your connection string To have your application use a readable secondary, add to the connection string: ;ApplicationIntent=ReadOnly 33 | 9/18/2018 | AlwaysOn Availability Groups 101

34 AlwaysOn Lessons Learned
Request the DNS name and IP for windows cluster and Availability Group Listener early, they can take a while Research prerequisites, make sure all patches, versions, components are optimal to support AlwaysOn Schedule and plan out in advance, get key players on board in the beginning Schedule implementation in two phases: Configuration of clusters, storage, SQL server stand alone instances Implementation of AlwaysOn 34 | 9/18/2018 | AlwaysOn Availability Groups 101

35 Bonus Trick ALTER DATABASE [XXXXX] SET HADR RESUME;
Sometimes, when a database is in the state of “not synchronizing”, and all other issues have been resolved, running the below command might get it back to healthy: ALTER DATABASE [XXXXX] SET HADR RESUME; 35 | 9/18/2018 | AlwaysOn Availability Groups 101

36 Thank you for your time! Questions? 9/18/2018 |
9/18/2018 | AlwaysOn Availability Groups 101


Download ppt "AlwaysOn Availability Groups 101"

Similar presentations


Ads by Google