Setting-up SharePoint 2010 stretched farm

Some enterprises have data centers that are located close to one another with high-bandwidth connections so that they can configure SHarePoint 2010 as a single farm to achieve high-availability as well as low RTO/RPO,we call it as a "stretched" farm. For a stretched farm to work, there must be less than 1 millisecond latency between SQL Server and the front-end Web servers in one direction, and at least 1 gigabit per second bandwidth.

In this scenario, you can provide fault tolerance by following the standard guidance for making databases and service applications redundant.

The following post guides you on how to setup stretched farm. I will post additional topics related to stretch farm such as search failover.

The following post is based on the following configuration:

Primary Site

WFE Server

APP Server

SQL

Services Running

SP2010

 

 

  • Access
  • Application Discovery and Load Balancer
  • Enterprise Search (Query)
  • Excel Services
  • PowerPoint
  • Security Token Service
  • Visio Graphics
  • Web Analytics
  • Word Viewing

 

SP2010APP1

 

  • Application Discovery & Load Balancer
  • Business Data Connectivity Services
  • Enterprise Search (Crawl)
  • Managed Metadata
  • PerformancePoint
  • Secure Store Service
  • Security Token
  • User Profiles
  • Word Automation

 

 

 

DCSQL

  • Database Server

Secondary - Stretched Site

WFE Server

APP Server

SQL

Services Running

DRSQLSP2010

 

 

  • Access
  • Application Discovery and Load Balancer
  • Enterprise Search (Query)
  • Excel Services
  • PowerPoint
  • Security Token Service
  • Visio Graphics
  • Web Analytics
  • Word Viewing

 

DRSP2010APP1

 

  • Application Discovery & Load Balancer
  • Business Data Connectivity Services
  • Enterprise Search (Crawl)
  • Managed Metadata
  • PerformancePoint
  • Secure Store Service
  • Security Token
  • User Profiles
  • Word Automation

 

 

 

DRSQLSP2010

  • Database Server

  • Web Applications that we currently have

 

  • In order to have stretched farm, the databases need to be mirrored. So, we're going to setup synchronous mirroring. In order to setup stretched farm, we need to get the list of databases used by SharePoint 2010 Get-SPDatabase cmdlet from SharePoint Powershell

Get-SPDatabase | select Name |Format-List > C:\Script\dblist.txt

Here's the result

Name : UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0

Name : SharePoint_Config_2010

Name : Search_Service_Application_SharePointServer_CrawlStoreDB_8e9425630542404

       cb93dd470bdb85d82

Name : Search_Service_Application_SharePointServer_PropertyStoreDB_c12560cf7322

       4e3bb563e3424ce51bce

Name : SharePoint_Admin_Content_2010

Name : WSS_Content_2010

Name : WSS_Content_My_2010

Name : WSS_Content_mysites_2010

Name : WSS_Content_sp2010

Name : WSS_Content_STPLab2010

Name : WSS_Content_Temp

Name : Search_Service_Application_SharePointServer_DB_b4c715175e0c4827b7b324c02afd7f96

Name : UM_MMS

Name : SharedServices_2010

Name : WSS_UsageApplication

Name : UserProfileUM_SyncDB_a5502148-ca0a-4dbc-acfe-8d1f1717c843

  • Set-up the databases to full-recovery mode for those databases except the logging database/WSS_UsageApplication

USE [master]

GO

ALTER DATABASE [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0] SET RECOVERY FULL WITH NO_WAIT

GO

ALTER DATABASE [SharePoint_Config_2010] SET RECOVERY FULL WITH NO_WAIT

GO

ALTER DATABASE [Search_Service_Application_SharePointServer_CrawlStoreDB_8e9425630542404cb93dd470bdb85d82] SET RECOVERY FULL WITH NO_WAIT

GO

....

  • Back-up the database and the transaction log

USE [master]

GO

BACKUP DATABASE [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]

    TO DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.bak'

GO

BACKUP LOG [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]

    TO DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.trn'

GO

 

BACKUP DATABASE [SharePoint_Config_2010]

    TO DISK = 'C:\DBBackup\SharePoint_Config_2010.bak'

GO

BACKUP LOG [SharePoint_Config_2010]

    TO DISK = 'C:\DBBackup\SharePoint_Config_2010.trn'

GO

.......

  • Copying the backup files to the mirror SQL Server location
  • Restore the database and the transaction log on the secondary site/stretched site SQL Server

USE [master]

GO

RESTORE DATABASE [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]

    FROM DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.bak'

        WITH FILE=1, NORECOVERY

GO

RESTORE LOG [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]

    FROM DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.trn'

        WITH FILE=1, NORECOVERY

GO

 

.......

  • Setup SQL Server mirroring with the mirrored partner

Follow the instructions provided on the following link:

How to: Configure a Database Mirroring Session (SQL Server Management Studio)

http://msdn.microsoft.com/en-us/library/ms188712.aspx

Manually setup the SQL Mirroring  

  • We need to add failoverserviceinstace for each sharepoint database involved within the stretched farm. We can do the setting from PowerShell to add the drsqlsp2010.contoso.com into the failoverserver property. By running the following script:

$db = get-spdatabase | where {$_.Name -eq "UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0"}

$db.AddFailoverServiceInstance("DRSQLSP2010")

$db.Update()

 

$db = get-spdatabase | where {$_.Name -eq "SharePoint_Config_2010"}

$db.AddFailoverServiceInstance("DRSQLSP2010")

$db.Update()

 

......

Verify the result.

PS C:\> Get-SPDatabase |select Name,failoverserver

Name FailoverServer

---- --------------

UserProfileUM_SocialDB_f189d285c9554... SPServer Name=DRSQLSP2010

SharePoint_Config_2010 SPServer Name=DRSQLSP2010

Search_Service_Application_SharePoin... SPServer Name=DRSQLSP2010

Search_Service_Application_SharePoin... SPServer Name=DRSQLSP2010

SharePoint_Admin_Content_2010 SPServer Name=DRSQLSP2010

WSS_Content_2010 SPServer Name=DRSQLSP2010

WSS_Content_My_2010 SPServer Name=DRSQLSP2010

WSS_Content_mysites_2010 SPServer Name=DRSQLSP2010

WSS_Content_sp2010 SPServer Name=DRSQLSP2010

WSS_Content_STPLab2010 SPServer Name=DRSQLSP2010

WSS_Content_Temp SPServer Name=DRSQLSP2010

Search_Service_Application_SharePoin... SPServer Name=DRSQLSP2010

UM_MMS SPServer Name=DRSQLSP2010

SharedServices_2010 SPServer Name=DRSQLSP2010

WSS_UsageApplication SPServer Name=DRSQLSP2010

UserProfileUM_SyncDB_a5502148-ca0a-4... SPServer Name=DRSQLSP2010

 

The command above added the failover partner to the connection string used by sharepoint. So, in case the server DCSQL failed, the server will try to connect to DRSQLSP2010. We can see from the information put in the registry on each of the sharepoint server.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB]

"dsn"="Data Source=dcsql;Failover Partner=DRSQLSP2010;Initial Catalog=SharePoint_Config_2010;Integrated Security=True;Enlist=False;Connect Timeout=15"

  • We simulated to change the principal to DRSQLSP2010 to see whether SharePoint can automatically failover to the specified server or not. In the real environment, you'll need to make sure that you can get the SQL server on the stretched site to be able to recover from broken SQL mirroring as well as be able to get database get-up and running normally.

 

And we've got the mirrored server as the principal now

  • Once we did the failover to the mirror, we can see the following entries on the ULS log, saying that the SQL Server failover connection detected.

w3wp.exe (0x0FCC) 0x01C0 SharePoint Server Database tzkm Medium SQL Server failover connection detected. SQL Server dcsql failing over to SQL server DRSQLSP2010.     

  • Verifying the feature do work after failover such as Search, MMS, user profile, and other services as necessary

That's the setup that we need to go through to setup stretched farm. In the next post, I'll explore in more detail related to SharePoint components failover in disaster recovery condition.