0% found this document useful (0 votes)
167 views

Steps To Configure SQL Server Availability Groups

The document outlines the steps to configure AlwaysOn availability groups for high availability on SQL Server using a Windows failover cluster with two nodes: 1. Configure a Windows cluster with two nodes and add a virtual cluster name. Enable the Failover Clustering feature and create a cluster called "SQLAlwaysOn" with nodes "SQLCLU2" and "SQLCLU3". 2. Enable the AlwaysOn High Availability feature for the SQL Server instances on each node. 3. Configure an availability group called "AdventureWorks" with the "Adventure Works" database. Select automatic failover and allow read-only connections on the secondary. 4. The availability group is created along with a listener

Uploaded by

Mir Jawad Ali
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
167 views

Steps To Configure SQL Server Availability Groups

The document outlines the steps to configure AlwaysOn availability groups for high availability on SQL Server using a Windows failover cluster with two nodes: 1. Configure a Windows cluster with two nodes and add a virtual cluster name. Enable the Failover Clustering feature and create a cluster called "SQLAlwaysOn" with nodes "SQLCLU2" and "SQLCLU3". 2. Enable the AlwaysOn High Availability feature for the SQL Server instances on each node. 3. Configure an availability group called "AdventureWorks" with the "Adventure Works" database. Select automatic failover and allow read-only connections on the secondary. 4. The availability group is created along with a listener

Uploaded by

Mir Jawad Ali
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 15

Step 1: Configure Windows cluster and add nodes.

I have two VMs with Windows server 2008 R2 Enterprise edition 64 bit and SQL server Denali CTP3 x64 and Im going to create a windows cluster just by adding 2 nodes and a virtual name for the cluster . Starting from Windows server 2008 failover cluster manager has to be enabled from roles and features applet. The cluster required for host Always on / HADR database doesnt need to have shared storage or instance virtual name, the cluster can just be created and validated with a virtual name for it, I am using the virtual name for my cluster as SQLAlwaysON and the nodes are SQLCLU2 and SQLCLU3. The configured windows cluster SQLAlwaysON looks as below

Nodes SQLCLU2 and SQLCLU3 are parFCFt of the cluster SQLAlwaysON

Step 2: Enable AlwaysON high availability for SQL services Now the windows cluster SQLAlwaysON is setup with 2 nodes that has SQL server Denali CTP3 installed in it, the SQL server services in SQL server configuration manager will have the cluster name detected automatically.

Go to SQL server configuration manager and right click SQL server engine services and tab to the AlwaysOnHighAvailability page, then tick the enable AlwaysON high availabilities group on both the instances on both nodes.

This change requires SQL server services to be restarted on both the nodes/instances. Step 3: Configure AlwaysON / HADR Before continuing to configure the high availability group, decide the group of databases that you will be including. I have chosen Adventure Works database for this test purpose and I will configure HADR for these databases from SQLCLU2(Primary) to SQLCLU3(Secondary). I am seeing this feature as a perfect fit of SHAREPOINT server databases and all other pre written or custom apps that has multiple databases to work on Image below shows instances I will be working on to configure AlwaysON for 4 adventure works database

Drill down the management folder and right click the Availability groups folder and choose New Availability group Wizard ,

The wizard opens up and looks like

Specify a name for availability group in the next window

Specify / Select the list of databases in the next screen .Only databases with FULL recovery model will be shown in this wizard .This page will exclude system databases and simple recovery database. Also to remember is , a database can either be configured for database mirroring or AlwaysON

In the next screen we must specify the Replica properties( SQL Servers instances that are part of the windows cluster SQLAlwaysON , in my case) Options for Replica mode: Automatic failover, High Performance and High Safety Im choosing Automatic failover in my test case and each options here decides what purpose you are using AlwaysON for ! Options for Connection mode in secondary state: Disallow connection, allow all connections and allow only read-intent connections Im choosing allow only read-intent connections for the current secondary set of databases

Other tab on the same page is for specifying the ENDPOINT properties and the connect permissions for SQL service accounts same as Database mirroring

The next page lets us to create a DNS entry for this availability group which is the virtual name for this AG , eventually this will be data source name that App or client tools will use to connect to these group of databases

Now that all the properties , requirements are entered for AG creation the last screen is for starting the data synchronization

Once all the details are entered, the wizard configured the AlwaysON for us . As you can see only one database failed to be part of our HADR / Always group due to the filestream option not being enabled on the secondary instance SQLCLU3. We are not going to bother about it at least for now.

This wizard has given all summary/steps it has done to successfully accomplish the task. The failed items can be fixed later with the help of this screen. Step 4: Look whats happened On the primary server SQLCLU2, open the availability group folder in management node of SSMS and look whats newly included

As you can see the replicas are our 2 nodes and databases are Adventure works, the last item is interesting though. Group listener called MY_FIRST_ALWAYSON_LISTENER is configured as DNS entry to connect to the current PRIMARY SQL server and this is how its looks on secondary server SQLCLU3

AdventureWorks2008R2 database seems to be suspended as the restore did not succeed during AG configuration. Availability groups are now a server scoped objects ,any existing or newly created logins can be granted permissions on AG similar to an end point\server\login and server roles(only in Denali). Now lets have a look at the Windows failover cluster manager and see whats interesting there

Successfully creating the availability group in SSMS creates an entry for service/application for our AG with the AG name we used during the configuration. This looks similar to our SQL server clustered instances on Windows clusters but not for the whole instance rather for just a group of databases. Looking in to the MY_FIRST_ALWAYSON service/application for further details from the cluster manager

As you can see, the cluster resource is currently owned by SQLCLU2 which is our primary now and the DNS and IP address that we created for connecting to SQL server is also created as a dependent resource for this availability group. From now it can be managed as similar to SQL server cluster but only for group of databases. You can flick them across nodes etc., and still use the same virtual name to connect to databases. What Next? Now that we have successfully configured AlwaysON with ONE read only secondary, we should be able to force a manual failover or automatic failover for availability groups by shutting down the current primary server or SQL services. For configuring multiple replicas with CTP3 books online says to add the start up trace flag 9532. You could use your apps to use the name my_first_alwayson_listener to connect to the AG databases and the AlwaysON resolves the current primary node and connects to that instance. Apart from this high availability option, we could use standalone instance named sqlclu3 (current secondary) to act as reporting database as its configured to be read only as per my test setup.Im sure theres lot more to test this before the final RTM release ,I will try all possible scenarios and come up with my latest findings. I would like to test with having both copies of replica to be read/write I really love this feature as it gives high available option using Windows cluster failover and virtual naming methods, DR options with sticking on to principles of database mirroring and having multiple replicas to work on for various purpose there by segregating the load on your OLTP databases.

Read more: http://sql-articles.com/articles/high-availability/steps-to-configure-sqlalwayson/#ixzz1jziEFnae

You might also like