Export (0) Print
Expand All

Configure and manage SQL Server availability groups for SharePoint Server

SharePoint 2010
 

Topic Last Modified: 2012-03-26

This article describes how to configure and manage AlwaysOn Availability Groups to enable high availability for a SharePoint Server 2010 farm.

The article assumes the following:

  • You are familiar with the concepts and terms presented in Plan for availability (SharePoint Server 2010),

  • You have a working knowledge of Windows Server Failover Clustering.

  • You have a working knowledge of the Microsoft SQL Server 2012 high availability features.

In this article:

SQL Server 2012 AlwaysOn provides a new enterprise-level high availability and disaster recovery solution. This solution supports the following two configurations for high availability:

  • AlwaysOn Availability Group

    Enables failover for multiple databases

  • AlwaysOn Failover Cluster instance

    Enables failover at the instance level

From a SharePoint Server perspective, AlwaysOn Availability Groups provide the optimum solution for high availability and disaster recovery.

AlwaysOn is not just a combination of database mirroring and database clustering. It is a completely new feature that co-exists with existing high availability and disaster recover options such as mirroring and log shipping. For an overview of this feature, see the AlwaysOn FAQ for SQL Server 2012 (http://go.microsoft.com/fwlink/p/?LinkId=245659). For a more details about the benefits of AlwaysOn Availability Groups and an overview of AlwaysOn Availability Groups terminology, see AlwaysOn Availability Groups (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkId=245660).

An availability group enables you to specify a set of databases that you want to fail over together. When an availability group fails over to a target, all the databases in the group fail over as well. Because SQL Server 2012 can host multiple availability groups on a single server, you can configure AlwaysOn to fail over to SQL Server instances on different servers, which reduces the need to have idle standby servers to handle the full load of the primary server. The next illustration shows the main parts of an AlwaysOn Availability Group environment.

SQL Server AlwaysOn with Availability Group

Looking at the previous illustration, you can see the following:

  • Each availability group consists of a collection of read-write primary databases and supports one to four secondary databases that are a corresponding copy of the primary databases.

  • The primary databases and secondary databases are maintained by a primary replica and one to four secondary replica.

  • Each replica is hosted on a specific instance of SQL Server and maintains a local copy of each availability database that belongs to the availability group.

  • An availability group fails over at the level of an availability replica.

The primary replica makes the primary databases available for read-write connections from clients and sends transaction log records for each primary database to every secondary replica. Each secondary replica applies transaction log records to its secondary databases.

An availability group supports a failover environment for a discrete set of user databases, which are known as availability databases, that fail over together as a single unit. An availability group supports a set of primary databases and one to four sets of corresponding secondary databases. An availability group fails over at the level of an availability replica.

noteNote
Database issues, such as a database becoming suspect due to a loss of a data file, deletion of a database, or corruption of a transaction log do not cause failovers.

The primary replica makes the primary databases available for read-write connections from clients and, also, sends transaction log records for each primary database to every secondary replica. Each secondary replica maintains a set of secondary databases. Every secondary replica applies transaction log records to its own set of secondary databases and serves as a potential failover target for the availability group. Optionally, you can configure one or more secondary replicas to support read-only access to secondary databases. You can configure any secondary replica to permit backups on secondary databases.

Deploying AlwaysOn Availability Groups requires a Windows Server Failover Clustering (WSFC) cluster. Each availability replica of a given availability group must reside on a different node of the same Windows Server Failover Clustering (WSFC) cluster.

AlwaysOn provides many benefits and the following are noteworthy for a SharePoint environment:

  • Provides more granularities in managing databases as a group.

  • Supports alternative availability modes (asynchronous and synchronous) on group replicas.

  • Supports automatic, manual, and forced client failover.

  • Provides better utilization of server hardware by offloading read workloads to a secondary instance (additionally, offloading workloads and backups improves performance on the primary replica).

For a more details the benefits of AlwaysOn Availability Groups, see AlwaysOn Availability Groups (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkId=245660).

The following minimum requirements and prerequisites are needed to deploy a SharePoint farm in an AlwaysOn environment.

To create and use AlwaysOn Availability Groups you have to install SQL Server 2012 on a Windows Server Failover Clustering (WSFC) cluster.

Although configuring a WSFC cluster is out of the scope for this article, you should be aware of the following if you plan to set up a cluster:

  • All the cluster nodes must be in the same Active Directory Domain Services (AD DS) domain.

  • Each availability replica in an availability group must reside on a different node of the same Windows Server Failover Clustering (WSFC) cluster.

  • The cluster creator must have the following capabilities:

A very important aspect of configuring failover clustering and AlwaysOn is determining the quorum votes that are needed for the cluster nodes.

For more information, see WSFC Quorum Modes and Voting Configuration (SQL Server) ( http://go.microsoft.com/fwlink/p/?LinkId=245665) and Configure Cluster Quorum NodeWeight Settings ( http://go.microsoft.com/fwlink/p/?LinkId=245666).

We recommend that you fully understand the prerequisites and restrictions for configuring an AlwaysOn environment. For more information, see Prerequisites, Restrictions, and Recommendations for AlwaysOn Availability Groups (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkId=245668). This article provides the following information:

  • Windows System Requirements and Recommendations

  • Server Instance Prerequisites and Restrictions

  • Prerequisites and Restrictions for Using a SQL Server Failover Cluster Instance (FCI) to Host an Availability Replica

  • Availability Group Prerequisites and Restrictions

  • Availability Database Prerequisites and Restrictions

noteNote
You can install SQL Server 2012 on Windows Server core, which has a reduced attack surface and requires fewer hot fixes and security updates. However, SharePoint Server cannot be installed on Windows Server core. For more information, see Server Core for Windows Server 2008 R2 [Server Core for Windows Server 2008 R2 (http://go.microsoft.com/fwlink/p/?LinkId=245669).

In addition to the documented minimum hardware and software requirements, you must install Microsoft SharePoint Server 2010 with Service Pack 1 (SP1)to deploy SharePoint Server on SQL Server 2012. We also recommend that you install the December cumulative update to take advantage of the performance gains that this update provides. For more information, see Description of the SharePoint Server 2010 cumulative update package (SharePoint server-package): December 13, 2011 (http://go.microsoft.com/fwlink/p/?LinkID=237662).

The following steps provide the recommended installation sequence and identify key configurations for deploying AlwaysOn for a SharePoint farm. Detailed procedures are provided in Detailed configuration steps.

noteNote
This article assumes that the farm that you configure for high availability is a new deployment. This includes Windows Server 2008 R2 Enterprise or Windows Server 2008 R2 Datacenter, SQL Server 2012, and Microsoft SharePoint Server 2010.
Create an AlwaysOn environment for a farm
  1. Select or create a Windows Server failover cluster. For more information, see Failover Clusters (http://go.microsoft.com/fwlink/p/?LinkID=142423)

  2. Install the prerequisites for SQL Server 2012 on each cluster node. For more information, see Prerequisites, Restrictions, and Recommendations for AlwaysOn Availability Groups (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkID=245668)

  3. Install SQL Server 2012 on each cluster node.

  4. Configure SQL Server 2012 for using AlwaysOn Availability Groups.

  5. Create a temporary user database or select an existing database.

  6. Create a network share for synchronization.

  7. Create a new availability group.

  8. Create a Client Access Point.

  9. Install Microsoft SharePoint Server 2010 with Service Pack 1 (SP1).

    For more information, see the “Service Pack 1 (SP1)” section of Updates for SharePoint 2010 Products (http://go.microsoft.com/fwlink/p/?LinkID=209614).

  10. Create the SharePoint farm.

  11. Add the SharePoint databases to the availability group.

The following illustration shows a SharePoint Server 2010 farm (SPHA_farm) that uses an availability group named SP_AG1. We'll use this farm as an example for configuring AlwaysOn.

Availability group and replicas for farm

For ease of use, we divide the detailed configuration steps to deploy the test farm in an AlwaysOn environment into the following major phases:

  • Create a Windows Server failover cluster.

  • Install and configure SQL Server 2012.

  • Create an availability group.

  • Create a client access point.

  • Install and configure SharePoint Server 2010.

  • Add the SharePoint databases to the availability group.

Obtain access to, or create a three node Windows Server Failover Clustering (WSFC) cluster that you can use for installing SQL Server 2012 on each node.

Install SQL Server 2012. For installation instructions see, Installation for SQL Server 2012 (http://go.microsoft.com/fwlink/p/?LinkId=245717).

You must take into account the SharePoint Server 2010 database requirements. Refer to the following articles:

importantImportant
You must deploy and configure SQL Server 2012 the same on each server that will be in the availability group.

Install SQL Server 2012 prerequisites on each cluster node. For more information, see Prerequisites, Restrictions, and Recommendations for AlwaysOn Availability Groups (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkID=245668)

Use the following procedures to enable Named Pipes and AlwaysOn High Availability. These configurations have to be done on each server that will be part of the availability group.

The following procedures are required to prepare the SQL Server environment and then create an availability group.

To create the availability group, at least one user database must exist. For more information, see Creation and Configuration of Availability Groups (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkId=245720).

Use the following procedure to create a temporary user database that will be the primary replica for the group.

Create a temporary user database
  1. Log on to the server that will host the primary replica, which is SPVNEXT-SRV1 in our example. You require one of the following permissions in the master database in order to create the new database: CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE.

  2. Start SQL Server Management Studio.

  3. In Object Explorer, right-click Databases and then click New Database.

  4. In the New Database dialog box, type the Database name:, which is "TemporaryUserDB" in our example. Because this is a temporary database that gets deleted after we create the availability group, we can use the default settings. Click OK.

    Because the New Availability Group Wizard will not create an availability group unless the user database has been backed up, you have to back up the temporary database.

  5. In Object Explorer expand Databases and right-click the temporary database that you just created. Pick Tasks and then pick Back Up.

  6. In the Back Up Database dialog box, click OK to accept all the default settings and create the back up.

A network share must exist and must be accessible by all the nodes in the AlwaysOn configuration to do the initial data synchronization between all the cluster nodes that host a replica. For more information, see Network Shares Extension (http://go.microsoft.com/fwlink/p/?LinkId=245722) and File Services (http://go.microsoft.com/fwlink/p/?LinkId=163091).

About replicas

Every availability replica is assigned an initial role—either the primary role or the secondary role, which the availability databases of that replica inherit. The role of a given replica determines whether it hosts read-write databases or read-only databases as well as the type of failover and the type of commit.

The following table shows the information that you have to provide for each replica, either when you first create the availability group, or later when you are adding secondary replicas.

 

Replica information Description

Server Instance

Displays the name of the server instance that will host the availability replica.

Initial Role

Indicates the role that the new replica will initially perform: Primary or Secondary.

Automatic Failover (Up to 2)

Indicates the type of failover that the replica uses: automatic or manual.

Synchronous Commit (Up to 3)

Indicates the type of commit that is used for the replica.

Readable Secondary

Indicates whether or not a secondary replica can be read.

The configuration options are unavailable for read access, read-only, and read-only intent. For more information, see Readable Secondary Replicas (AlwaysOn Availability Groups) (http://go.microsoft.com/fwlink/p/?LinkId=245736).

importantImportant
Readable secondaries are not currently supported for SharePoint Server 2010 runtime usage.
noteNote
When you add replicas to a group, you will also provide the endpoint for each replica and configure backup preferences. For more information, see Specify the Endpoint URL When Adding or Modifying an Availability Replica (SQL Server) (http://go.microsoft.com/fwlink/p/?LinkId=245737) and Backup on Secondary Replicas (AlwaysOn Availability Groups) (http://go.microsoft.com/fwlink/p/?LinkId=208213).

Data synchronization

As part of the availability group creation process, you will have to synchronize the data on the primary replica with the data on the secondary replicas. The following restrictions exist for using the New Availability Group wizard to start data synchronization:

  • If the file paths on the secondary replica location are different from the file paths on the primary location, you have to start data synchronization manually.

  • If any secondary database exists on a secondary replica, you have to manually delete the secondary databases before you start data synchronization in the New Availability Group. However, if you want to use existing secondary databases, exit the New Availability Group wizard and start data synchronization manually.

  • To use the availability group wizard to synchronize data, you have to have a backup share that all the replicas can write to. You can specify the share by browsing to it or by entering its fully qualified universal naming convention (UNC) path name, \\Systemname\ShareName\Path\, in the Specify a shared network location accessible by all replicas box.

For each database in the availability group, the Start Data Synchronization page displays the progress of the following operations:

  • Creating a full database backup of the primary database on the network share.

  • Creating a full database backup of the primary database on the network share.

  • Restoring these backups onto the secondary replica location. These restore operations both use RESTORE WITH NORECOVERY option and leave the new secondary database in the RESTORING state.

  • Joining the secondary database to the availability group. This step puts the secondary database in the ONLINE state and starts data synchronization for this database.

Use the following procedure to create an availability group on the primary replica, which is SPVNEXT-SRV1 in our example.

Create the availability group
  1. Log on to the server that will host the primary replica and start SQL Server Management Studio.

    Permission to create an availability group requires membership in the db_owner fixed database role and either CREATE AVAILABILITY GROUP server permission, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.

  2. To start the New Availability Group Wizard, right-click AlwaysOn High Availability and then click New Availability Group Wizard.

  3. Click Next to advance to the Specify Name page. Enter SP-AG1 as the name of the new availability group in the Availability group name: box. This name must be: a valid SQL Server identifier, unique on the Windows Server Failover Clustering cluster and unique on the domain.

  4. On the Select Databases page, all user databases that are eligible to become the primary database for the new availability group are listed on the User databases on this instance of SQL Server grid. Pick TemporaryUserDB, and then click Next.

  5. On Specify Replicas page, use the following tabs to configure the replicas for SP-AG1: Replicas, Endpoints, and Backup Preferences.

  6. On the Listener tab, configure an availability group listener for our example. An availability group listener is a server name to which clients can connect in order to access a database in a primary or secondary replica of an AlwaysOn availability group. Availability group listeners direct incoming connections to the primary replica or to a read-only secondary replica. The listener provides fast application failover after an availability group fails over. For more information, see Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server).

  7. Select the desired configuration for each instance in the Selected instances grid, and then click Next.

  8. Click Finish to create the Availability Group.

  9. The Select Initial Data Synchronization page lets you select a synchronization preference and specify the shared network location that all replicas can access. For our environment we'll accept the default, Full, which performs full database and log backups. Click Next.

  10. The Validation page of the wizard displays the results of six checks before letting you continue with availability group creation. If all checks pass, you can click Next to continue. If any tests fail, the wizard prevents you from continuing until you correct the error and run the validation tests again by clicking Re-run Validation. When all the tests pass, click Next to continue.

  11. On the Summary page, verify the configuration of the replica that you are adding and click Finish if you are satisfied with the configuration and want to keep it. If not, you can click Previous to return to previous wizard pages.

An access point is a name and an associated IP address. The client access point lets you connect to the availability group when you create a SharePoint farm. For more information about Client Access Points in a failover cluster, see Understanding Access Points (Names and IP Addresses) in a Failover Cluster (http://go.microsoft.com/fwlink/p/?LinkId=245741). The following procedure describes how to create an access point.

Create a client access point
  1. Log on to the server that hosts the Failover Cluster Manager console. To create an access point you must have a domain account that has administrator rights and permissions on all the servers in the cluster.

  2. Expand the cluster node and then expand Services and Applications.

    The availability group, SP-AG1 is listed here as a resource.

  3. Right-click SP-AG1, choose Add a resource, and then click 1 - Client Access Point.

    This starts the New Resource Wizard.

  4. The Name: field of the Client Access Point page is already prepopulated with the name of the availability group, SP-AG-1. Because duplicate names cannot exist, type SP-AG1AP, and then click Next.

  5. The Confirmation page shows the network name and IP addresses that will be used for the access point. Click Next.

  6. Click Finish to exit the wizard.

  7. Expand Services and applications, and then click SP-AG1 to view a summary of the new settings. SP-AG1AP should be displayed under Server Name.

  8. Optional. Verify that SP-AG1AP is online. If it’s not, right-click SP-AG1AP, and click Bring this resource online.

  9. Optional. Right-click SP-AG1AP, and then click Show Dependency Report to verify that the access point is configured correctly for the availability group. If it’s not, open the Properties dialog box for SP-AG1AP and correct the configuration. The Properties dialog box provides the following tabs for reconfiguring the access point: General, Dependencies, Policies and Advanced Policies.

At this point in the process, you can install SharePoint Server 2010 and create the farm. Use the steps in the following general procedure to install and configure SharePoint Server.

Install and configure SharePoint Server 2010
  1. Download and install Microsoft SharePoint Server 2010 with Service Pack 1 (SP1) and the June 2011 cumulative update refresh. For more information, see the “Service Pack 1 (SP1)” section of Updates for SharePoint 2010 Products (http://go.microsoft.com/fwlink/p/?LinkID=209614). To install the service pack you need the same permissions that are required to install SharePoint Server 2010. For more information, see Initial deployment administrative and service accounts (SharePoint Server 2010).

  2. Run the Microsoft SharePoint Products Preparation Tool, which installs all required prerequisites to use SharePoint Server.

  3. Run Setup, which installs binaries, configures security permissions, and edits registry settings for SharePoint Server 2010.

  4. Run SharePoint Products Configuration Wizard, which installs and configures the configuration database, the content database, and installs the SharePoint Central Administration Web site.

    When you run the wizard, you have to identify the server that will host the SharePoint databases. On the Specify Configuration Database Settings page, in the Database server box, type SP-AG1AP as the name of the computer that is running SQL Server.

  5. Configure browser settings.

  6. Run the Farm Configuration Wizard, which configures the farm, creates the first site collection, and selects the services that you want to use in the farm.

  7. Perform post-installation steps.

The final phase of setting up AlwaysOn for a SharePoint Server 2010 farm entails adding the SharePoint databases to the availability group and synchronizing secondary replicas to the primary replica.

On the server that hosts the primary replica, you have to run the Add Databases to Availability Group wizard to add all the SharePoint databases to the availability group. The procedure is the same as the procedure for creating an availability group.

Add databases to the availability group
  1. Log on to the server that will host the primary replica and start SQL Server Management Studio. The account you use must be a member of the Local Administrators group for each server where SharePoint Server 2010 will be installed as well as ALTER AVAILABILITY GROUP permission on the availability group, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission. In addition, joining a database to an availability group requires membership in the db_owner fixed database role.

  2. In Object Explorer, navigate to, and if necessary expand the Availability Groups.

  3. Right-click the example group, SP-AG1, and then click Add Database.

  4. On the Select Databases page, all user databases that are eligible to become the primary database for the new availability group are listed on the User databases on this instance of SQL Server grid. Use the checkboxes to identify all the databases that you want to add to the group, and then click Next.

  5. The Select Initial Data Synchronization page lets you select a synchronization preference and specify the shared network location that all replicas can access. For our environment we'll accept the default, Full, which performs full database and log backups. Click Next.

  6. The Validation page of the wizard displays the results of six checks before it lets you continue with availability group creation. If any tests fail, the wizard prevents you from continuing until you correct the error and run the validation tests again by clicking Re-run Validation. When all the tests pass, click Next to continue.

  7. On the Summary page, verify the configuration of the replica that you are adding, and then click Finish if you are satisfied with the configuration and want to keep it. If you want to change the configuration, click Previous to return to previous wizard pages.

You have to monitor an AlwaysOn environment for performance, health, and capacity.

Performance

New performance objects are provided monitoring the AlwaysOn environment. They are SQLServer:Database Replica (http://go.microsoft.com/fwlink/p/?LinkId=245745) and SQLServer:Availability Replica (http://go.microsoft.com/fwlink/p/?LinkId=245746).

Health and capacity

For general health monitoring you can use the Availability Groups Dashboard to obtain the health of the availability groups in the system. We recommend that you refer to the following posts on the official SQL Server AlwaysOn team blog to fully understand AlwaysOn health monitoring.

You can also use Transact-SQL to monitor availability groups by using the set of catalog and dynamic management views that are provided for AlwaysOn Availability Groups. For more information, see Monitor Availability Groups (Transact-SQL) (http://go.microsoft.com/fwlink/p/?LinkId=245747).

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft