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
SP2010APP1
DCSQL
Secondary - Stretched Site
DRSQLSP2010
DRSP2010APP1
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
USE [master]
GO
ALTER DATABASE [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0] SET RECOVERY FULL WITH NO_WAIT
ALTER DATABASE [SharePoint_Config_2010] SET RECOVERY FULL WITH NO_WAIT
ALTER DATABASE [Search_Service_Application_SharePointServer_CrawlStoreDB_8e9425630542404cb93dd470bdb85d82] SET RECOVERY FULL WITH NO_WAIT
....
BACKUP DATABASE [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]
TO DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.bak'
BACKUP LOG [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]
TO DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.trn'
BACKUP DATABASE [SharePoint_Config_2010]
TO DISK = 'C:\DBBackup\SharePoint_Config_2010.bak'
BACKUP LOG [SharePoint_Config_2010]
TO DISK = 'C:\DBBackup\SharePoint_Config_2010.trn'
.......
RESTORE DATABASE [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]
FROM DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.bak'
WITH FILE=1, NORECOVERY
RESTORE LOG [UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0]
FROM DISK = 'C:\DBBackup\UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0.trn'
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
$db = get-spdatabase | where {$_.Name -eq "UserProfileUM_SocialDB_f189d285c9554848a72f73ca9c8e9dc0"}
$db.AddFailoverServiceInstance("DRSQLSP2010")
$db.Update()
$db = get-spdatabase | where {$_.Name -eq "SharePoint_Config_2010"}
......
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
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
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"
And we've got the mirrored server as the principal now
w3wp.exe (0x0FCC) 0x01C0 SharePoint Server Database tzkm Medium SQL Server failover connection detected. SQL Server dcsql failing over to SQL server DRSQLSP2010.
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.