SharePoint 2010 – SQL 2012 Always On Configuration

SQL 2012 brings some great capabilities to the table for an “Always-On” environment. In this post we will configure our SQL 2012 environment to be ready for SharePoint. To begin with my environment is made up of the following:

1.2 x SQL 2012 Servers

2.1 x SharePoint Server

3.1 x AD Server

Of course in the real world I would have more servers than this, especially from the SharePoint side. Firstly you will need to install SQL 2012 which I am not going to cover here as it is just like installing any other version. Once installed you will need to access the “SQL Server Configuration Manager“.

LC 1

Once opened select the “SQL Services” and then “SQL Server (YOUR INSTANCE NAME)“.

LC 2 _SharePoint22

Right click your instance and select “Properties

LC 3 _SharePoint23

Before we can do anything we need to have made sure that we are running a base Windows Cluster, for details on this you can visit TechNet. Once this enabled you should be able to select the “AlwaysOn High Availability” and it should display your windows cluster name and a checkbox to enable the “AlwaysOn Availability Groups” feature.

LC 4 _SharePoint24

Check to enable the “AlwaysOn Availability Groups

LC 5 _SharePoint25

Click to apply the changes, you will then be told that you need to restart the services for it to take effect. Don’t do that yet.

LC 6 _SharePoint26

Now we need to enable named pipes communication for the SQL instance. Navigate to the “SQL Server Network Configuration” node then select “Named Pipes“, and choose to “Enable” it.

LC 7 _SharePoint27

As before you will be warned about the service needing restarting.

LC 8 _SharePoint28

This time you can either restart the services from the configuration window or access the SQL management studio and right click the server and choose “restart“.

LC 9 _SharePoint29

Now we have the basic configuration completed; now we need to create a test database to use for setting up the always on configuration. I created one called “TestAvailabilityDB“.

LC 10_SharePoint210

LC 11 _SharePoint211

Once it is created you “MUST” back it up, this is a pre-requisite for the always on configuration.

LC 13 _SharePoint212

LC 14 _SharePoint213

LC 15 _SharePoint214

Once you have backed up the database, you then need to navigate within SQL management studio to the “AlwaysOn High Availability” node and right click and choose “New Availability Group Wizard

LC 16 SharePoint215

As with most Microsoft products now we are given a great wizard to run through to create what we need.

LC 17 _SharePoint216

First we need to name the group, for me I called it “SQL-AVAIL-GRP

LC 18 _SharePoint217

Next we need to select the database we want to use, this will be the test one we created, and notice the status says it meets the prerequisites if the database was not backed up it would not allow you to select this database.

LC 19 _SharePoint218

Select the test database.

LC 19 _SharePoint218

When we press next we are presented with various options, the first setting is to add the replica servers for the “AlwaysOn” configuration. The primary server is already list; this is the current server you are running the wizard on.

LC 21 SharePoint220

Click the “Add Replica” button.

LC 22 SharePoint221

It will then allow you to connect to the server you wish to use; in my case it is called “DEV-SQL2“.

LC 23 SharePoint222

If you happen to get this error, it could be credentials, security or even network issues.

LC 24 SharePoint223

For me it was the Windows Firewall causing the problem. To resolve this I simply I turned off the “Domain Networks” firewall policy. I could have modified it I suppose but easier to just turn if off for now.

LC 25 SharePoint224

LC 26 _SharePoint225

Once the connection is made, you will now see the secondary server listed. By default the “Automatic Failover” and “Synchronous Commit” options are selected.

LC 27 SharePoint226

You also have the ability to define if the secondary is readable at all, for this example we will use the default of “No“. Further documentation can be found on TechNet about the logic behind these options.

LC 28 _SharePoint227

Once set you then need to check the endpoints and you can modify them but I kept them with the default values.

LC 29 SharePoint228

Now we need to specify where the backups should occur, for me I changed this to the “Primary“.

LC 30 SharePoint229

I then specified the path to use, which in the real world would not be on the SQL server but a shared path that all the SQL servers can see.

LC 31 _SharePoint230

Next apply the changes. Ass you can see the listener piece failed, that is because I wanted to run through the process manually.

LC 32 _SharePoint231

Ignore the error and continue.

LC 32 _SharePoint232

LC23 _SharePoint233

Once this has completed successfully now we need to create the listener. Navigate the “AlwaysOn High Availability“; go down to the “Availability Group Listeners” section.

LC 24 SharePoint234

Right click and choose “Add Listener”

LC31

We need to add a name (this will be created in DNS), a port to use and a static or dynamic IP. Best practice would dictate a static IP address. My details are as below:

LC32

Once done we need to open up the “Windows Failover Cluster Manager“.

LC33

Once the application opens expand our cluster, and then expand the “Services and Applications” section. Right click the availability group called “SQL-AVAIL-GRP” or whatever you called your group. Select the “Add Resource > Client Access Point” link.

LC34

Assign a name for the client access point and an IP address to use.

LC35

Apply the changes as shown below.

LC36

Once created successfully navigate to the same place and choose the “Bring this service or application online“.

LC37

The following status screen should now be displayed, showing everything is now online ready for use.

LC38

Now we have it all setup you should see the following when you expand the “AlwaysOn High Availability” node within SQL Management Studio.

LC39

When accessing the second SQL Server you should also see the database initially set in “Synchronizing Mode“.

Configuration

Until the database has synchronized, the availability dashboard will display the following:

Configuration

When running in this mode, if we were to initiate a manual failover we will get the following message:

Configuration

Check out more interesting blogs by Liam Cleary by clicking here>>

Why not keep up to date with his amazing work by joining our community or by following us on twitter or Facebook!

Share this on...

Rate this Post:

Share: