Return to site

Sharepoint Failover Farm

broken image


I'm working on a large, enterprise-scale project for a gov't agency and as part of our disaster recovery effort, we need to mirror a SharePoint 2007 farm to another server. Both servers are exactly the same and they run under the same domain/AD. The farm is actually not that big. It consists only of a few site collections and it's on one server. We have SharePoint farm in front end 2013. We are using sql server 2014 enterprise edition. Initially, SharePoint farm is connected to Server A. But we wanted to configure Always On availability for this. We configured it from Sql end.Server B is the secondary replica. And we have configured the listener also. Select Application Management - Manage content databases. Click the content database name. Fill in the 'Failover Database Server' with the name of the mirror server. Repeat for each content database. PowerShell can also be used to configure failover for SharePoint 2010 content databases. SharePoint 2016. Installed on Azure rksp virtual machine as a single-server farm with mysites host and portal site collection. SharePoint 2016 is already installed on the on-premises farm before the start of this lab. Windows Server Failover Cluster. Installed Windows Server Failover Cluster feature on homesp and rksql as they are database. SharePoint 2016. Installed on Azure rksp virtual machine as a single-server farm with mysites host and portal site collection. SharePoint 2016 is already installed on the on-premises farm before the start of this lab. Windows Server Failover Cluster. Installed Windows Server Failover Cluster feature on homesp and rksql as they are database.

This is a post I've been meaning to write for some time, but I'm only now getting around to it. It's a quick one, and it's intended to share a couple of observations and a script that may be of use to those of you who are SharePoint 2010 administrators.

Mirroring and SharePoint

The use of SQL Server mirroring isn't something that's unique to SharePoint, and it was possible to leverage mirroring with SharePoint 2007 … though I tended to steer people away from trying it unless they had a very specific reason for doing so and no other approach would work. There were simply too many hoops you needed to jump through in order to get mirroring to work with SharePoint 2007, primarily because SharePoint 2007 wasn't mirroring-aware. Even if you got it working, it was … finicky.

SharePoint 2010, on the other hand, is fully mirroring-aware through the use of the Failover Partner keyword in connection strings used by SharePoint to connect to its databases.

(Side note: if you aren't familiar with the Failover Partner keyword, here's an excellent breakdown by Michael Aspengren on how the SQL Server Native Provider leverages it in mirroring configurations.)

There are plenty of blog posts, articles (like this one from TechNet), and books (like the SharePoint 2010 Disaster Recovery Guide that John Ferringer and I wrote) that talk about how to configure mirroring. It's not particularly tough to do, and it can really help you in situations where you need a SQL Server-based high availability and/or remote redundancy solution for SharePoint databases.

This isn't a blog post about setting up mirroring; rather, it's a post to share some of what I've learned (or think I've learned) and related 'ah-ha' moments when it comes to mirroring.

What Are You Pointing At?

This all started when Jay Strickland (one of the Quality Assurance (QA) folks on my team at Idera) ran into some problems with one of our SharePoint 2010 farms that was used for QA purposes. The farm contained two SQL Server instances, and the database instances were setup such that the databases on the second instance mirrored the databases on the first (principal) instance. Jay had configured SharePoint's service applications and Web applications for mirroring, so all was good.

But not really. The farm had been running properly for quite some time, but something had gone wrong with the farm's mirroring configuration – or so it seemed. That's when Jay pinged me on Skype one day with a question (which I'm paraphrasing here):

Is there any way to tell (from within SharePoint) which SQL Server instance is in-use by SharePoint at any given time for a database that is being mirrored?

It seemed like a simple question that should have a simple answer, but I was at a loss to give Jay anything usable off the top of my head. I told Jay that I'd get back to him and started doing some digging.

The SPDatabase Type

Putting on my developer hat for a second, I recalled that all SharePoint databases are represented by an instance of the SPDatabase type (Microsoft.SharePoint.Administration.Database specifically) or one of the other classes that derive from it, such as SPContentDatabase. Running down the available members for the SPDatabase type, I came up with the following properties and methods that were tied to mirroring in some way:

  • FailoverServer
  • FailoverServiceInstance
  • AddFailoverServiceInstance()

What I thought I would find (but didn't) was one or more properties and/or methods that would allow me to determine which SQL Server instance was serving as the active connection point for SharePoint requests.

In fact, the more digging that I did, the more that it appeared that SharePoint had no real knowledge of where it was actually connecting to for data in mirrored setups. It was easy enough to specify which database instances should be used for mirroring configurations, but there didn't appear to be any way to determine (from within SharePoint) if the principal was in-use or if failover to the mirrored instance had taken place.

The Key Takeaway

If you're familiar with SQL Server mirroring and how it's implemented, then the following diagram (which I put together for discussion) probably looks familiar:

This diagram illustrates a couple of key points:

  1. SharePoint connects to SQL Server databases using the SQL Server Native Client
  2. SharePoint supplies a connection string that tells the native client which SQL Server instances (as Data Source and Failover Partner) should be used as part of a mirroring configuration.
  3. It's the SQL Server Native Client that actually determines where connections are made, and the results of the Client's decisions don't directly surface through SharePoint.
    Number 3 was the point that I kept getting stuck on. I knew that it was possible to go into SQL Server Management Studio or use SQL Server's Management Objects (SMO) directly to gain more insight around a mirroring configuration and what was happening in real-time, but I thought that SharePoint must surely surface that information in some form.

Apparently not.

Checking with the Experts

I hate when I can't nail down a definitive answer. Despite all my reading, I wanted to bounce the conclusions I was drawing off of a few people to make sure I wasn't missing something obvious (or hidden) with my interpretation.

  • I shot Bill Baer (Senior Technical Product Manager for SharePoint and an MCM) a note with my question about information surfacing through SharePoint. If anyone could have given me a definitive answer, it would have been him. Unfortunately, I didn't hear back from him. In his defense, he's pretty doggone busy.
  • I put a shout out on Twitter, and I did hear back from my good friend Todd Klindt. While he couldn't claim with absolute certainty that my understanding was on the mark, he did indicate that my understanding was in-line with everything he'd read and conclusions he had drawn.
  • I turned to Enrique Lima, another good friend and SQL Server MCM, with my question. Enrique confirmed that SQL SMO would provide some answers, but he didn't have additional thoughts on how that information might surface through SharePoint.

Long and short: I didn't receive rock-solid confirmation on my conclusions, but my understanding appeared to be on-the-mark. If anyone knows otherwise, though, I'd love to hear about it (and share the information here – with proper recognition for the source, of course!)

Back to the Farm

In the end, I wasn't really able to give Jay much help with the QA farm that he was trying to diagnose. Since I couldn't determine where SharePoint was pointing from within SharePoint itself, I did the next best thing: I threw together a PowerShell script that would dump the (mirroring) configuration for each database in the SharePoint farm.

[sourcecode language='powershell']
<#
.SYNOPSIS
SPDBMirrorInfo.ps1
.DESCRIPTION
Examines each of the databases in the SharePoint environment to identify which have failover partners and which don't.
.NOTES
Author: Sean McDonough
Last Revision: 19-August-2011
#>
function DumpMirroringInfo ()
{
# Make sure we have the required SharePoint snap-in loaded.
$spCmdlets = Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction silentlycontinue
if ($spCmdlets -eq $Null)
{ Add-PSSnapin Microsoft.SharePoint.PowerShell }

# Grab databases and determine which have failover support (and which don't)
$allDatabases = Get-SPDatabase
$dbsWithoutFailover = $allDatabases | Where-Object {$_.FailoverServer -eq $null} | Sort-Object -Property Name
$dbsWithFailover = $allDatabases | Where-Object {$_.FailoverServer -ne $null} | Sort-Object -Property Name

# Write out unmirrored databases
if ($dbsWithoutFailover -eq $null)
{ Write-Host '`n`nNo databases are configured without a mirroring partner.' }
else
{
Write-Host ('`n`nDatabases without a mirroring partner: {0}' -f $dbsWithoutFailover.Count)
$dbsWithoutFailover | Format-Table -Property Name, Server -AutoSize
}

# Dump results for mirrored databases
if ($dbsWithFailover -eq $null)
{ Write-Host '`nNo databases are configured with a mirroring partner.' }
else
{
Write-Host ('`nDatabases with a mirroring partner: {0}' -f $dbsWithFailover.Count)
$dbsWithFailover | Format-Table -Property Name, Server, FailoverServer -AutoSize
}

Failover

# For ease of reading
Write-Host ('`n`n')
}
DumpMirroringInfo
[/sourcecode]

The script itself isn't rocket science, but it did actually prove helpful in identifying some databases that had apparently 'lost' their failover partners.

Additional Reading and Resources

  1. MSDN: Using Database Mirroring
  2. Whitepaper: Using database mirroring (Office SharePoint Server)
  3. Blog Post: Clarification on the Failover Partner in the connectionstring in Database Mirror setup
  4. TechNet: Configure availability by using SQL Server database mirroring (SharePoint Server 2010)
  5. Book: The SharePoint 2010 Disaster Recovery Guide
  6. Blog: John Ferringer's 'My Central Admin'
  7. Blog: Jay Strickland's 'Slinger's Thoughts
  8. Company: Idera
  9. MSDN: SPDatabase members
  10. MSDN: SQL Server Management Objects (SMO)
  11. Blog: Bill Baer
  12. Blog: Todd Klindt's SharePoint Admin Blog
  13. Blog: Enrique Lima's Intentional Thinking

Best Strategies – SharePoint Disaster Recovery in SharePoint 2016/13/07

Rohan Wiese ❘ August 3rd, 2018 ❘ 0 Comments

This post will help you to get knowledge about disaster recovery options and recovery supported technologies for SharePoint Server 2016 and SharePoint 2013 farm if there is a disaster.

The disaster recovery is the facility to recover from a scenario in which the primary data center that hosts a SharePoint Server farm is unable to continue to operate. Whatever is the nature of the issue and its reason, the data center failure is remarkable enough to perform the process mentioned in your organization's disaster recovery plan. In other words, you can keep a fully operational farm into production using computer resources, located in a data center which is not affected by the event.

SharePoint Server 2016 and SQL Server 2014 with Service Pack 1 (SP1) or SQL Server 2016, and SharePoint 2013 and SQL Server 2008 R2 with Service Pack 1 (SP1) or SQL Server 2012 offers configuration and content recovery options that can perform the Recovery Time Objective (RTO) and Recovery Point Objective (RPO) that are needed if there is a disaster in your business.

Overview – Disaster Recovery Strategy for SharePoint

In general, the disaster recovery strategy for a SharePoint Server farm must be efficient so that it can fulfill your organization's business requirements these are Recovery Time Objective (RTO) and Recovery Point Objective (RPO). RTO and RPO requirements are extracted by observing the downtime cost to the organization if there is a disaster.

The Downtime cost varies majorly between and within organizations, mainly due to the distinctive belongings of downtime. Commonly, the Business size is the main factor. Though there are many other factors. The process of setting a measure is finding the nature and implications of the failure. Thus, a failure of a critical application may result in the following types of losses:

  • There may be a loss of service of the application. The impact of downtime varies according to the application and the business.
  • There may be a loss of data. The potential loss of data is because of system outage can have serious legal and financial impact.

In maximum situations, the SharePoint products are only the application which is recovered when the data center is shutdown that is like a disaster. Despite this let's concentrate on the ways to recover your SharePoint Server 2016 farm at another location.

Despite the type and scale of a disaster, recovery includes the use of a standby data center by which you can also recover the farm.

Also Read: Common Reasons for Corruption in SharePoint Server

Recovery Options in Standby Data Center

The Standby data centers are needed when you are unable to recover the local redundant systems and backups due to the outage at the primary data center. The time and immediate action for replacement farm up and running at a different location is often known as a hot, warm, or cold standby. These farm recovery data centers are as follows:

  • Cold standby: A secondary data center that can supply availability within hours or days.
  • Warm standby: A secondary data center that can supply availability within minutes or hours.
  • Hot standby: A secondary data center that can provide availability within seconds or minutes.

Cold Standby Recovery Strategy

In this type of strategy, recovery is done by setting up a new farm at a new location, (preferably by using a scripted deployment), and restoring backups. Secondly, you can recover by restoring the farm using a backup solution like System Center 2016 – Data Protection Manager (DPM) or System Center 2012 – Data Protection Manager (DPM). The System Center Data Protection Manager protects your data at the computer operating system level and helps you restore each server individually.

Sharepoint Failover Farm - Video Results

Demerit: It is the slowest option to recover.

Warm Standby Recovery Strategy

In this disaster recovery scenario, you can create a warm standby environment by forming a duplicate farm at the substitute data center and make sure that it is updated regularly by using full and incremental backups of the primary farm.

Demerit: It can be very expensive and time-consuming to maintain.

Virtual Warm Standby Environments Solution

It offers a workable and cost-effective option for a warm standby recovery solution. So, you can develop virtual images of the production servers and ship virtual images to the standby data center. Ensure, that the virtual images are created are sufficient to give the level of farm configuration and content freshness that you should have for recovering the farm. Moreover, at the secondary location, there should be an accessible environment in which you can easily configure and connect the images for the re-creation of the farm environment.

Hot Standby Recovery Strategy

In this recovery scenario, first, you set up a failover farm in the standby data center so that it can undertake production operations immediately after the primary farm goes offline. The characteristic of an environment which have separate failover farm should be followed:

  1. You should maintain a separate configuration database and the SharePoint Central Administration website content database on the failover farm.
  2. Do all customizations must be located on both farms.
  3. The operating system, SQL Server, and SharePoint Server software updates must be used for both farms, for maintaining a consistent configuration in both farms.
  4. You can copy content databases of SharePoint Server to the failover farm by applying asynchronous mirroring, asynchronous commit on an availability group replica, or log-shipping.

Azure Resource Group Documentation

Demerit: It can be very expensive for both, configure and maintain.

Note:

The SQL Server mirroring is only used to copy databases to a single mirror server, but you can log-ship to multiple secondary servers. It is recommended that you should ignore this feature in new development work. Plan to change applications that currently use this feature.

The availability of network bandwidth and latency are main considerations when you are using a failover approach for disaster recovery. For this, you should consult with your SAN vendor to determine whether you can use SAN replication or another supported mechanism to provide the hot standby level of availability across data centers.

Redundant Service Application

The services which can be run cross-farm, for these you run a separate services farm that can be obtained from both the primary and the secondary data centers.

In case, services that cannot be run cross-farm, to give availability for the services farm itself, the strategy for providing redundancy across data centers for a service application changes. The condition required for this strategy to be employed depends on whether:

Sharepoint Failover Farm
  • There should be a business value in running the service application in the disaster recovery farm when it is not being used.
  • The databases linked with the service application can be log-shipped, asynchronously mirrored, or replicated using asynchronous commit.
  • The service application should run against read-only databases.

Requirements of System for Recovery

The systems must fulfill the following minimum requirements:

  • Check operating system version and all updates.
  • SQL Server versions and all updates.
  • SharePoint Server versions and all updates.

SharePoint Failover Disaster Recovery Farm

Despite, of above requirements, farm recovery time will also be affected by the availability of facilities and infrastructure components. Ensure that the following requirements are also meeting:

  • The power, cooling, network, directory, and SMTP are redundant.
  • Select a switching mechanism; whether DNS or hardware load balancing, are sufficient to meet your needs.

Alternative Solution

Failover

# For ease of reading
Write-Host ('`n`n')
}
DumpMirroringInfo
[/sourcecode]

The script itself isn't rocket science, but it did actually prove helpful in identifying some databases that had apparently 'lost' their failover partners.

Additional Reading and Resources

  1. MSDN: Using Database Mirroring
  2. Whitepaper: Using database mirroring (Office SharePoint Server)
  3. Blog Post: Clarification on the Failover Partner in the connectionstring in Database Mirror setup
  4. TechNet: Configure availability by using SQL Server database mirroring (SharePoint Server 2010)
  5. Book: The SharePoint 2010 Disaster Recovery Guide
  6. Blog: John Ferringer's 'My Central Admin'
  7. Blog: Jay Strickland's 'Slinger's Thoughts
  8. Company: Idera
  9. MSDN: SPDatabase members
  10. MSDN: SQL Server Management Objects (SMO)
  11. Blog: Bill Baer
  12. Blog: Todd Klindt's SharePoint Admin Blog
  13. Blog: Enrique Lima's Intentional Thinking

Best Strategies – SharePoint Disaster Recovery in SharePoint 2016/13/07

Rohan Wiese ❘ August 3rd, 2018 ❘ 0 Comments

This post will help you to get knowledge about disaster recovery options and recovery supported technologies for SharePoint Server 2016 and SharePoint 2013 farm if there is a disaster.

The disaster recovery is the facility to recover from a scenario in which the primary data center that hosts a SharePoint Server farm is unable to continue to operate. Whatever is the nature of the issue and its reason, the data center failure is remarkable enough to perform the process mentioned in your organization's disaster recovery plan. In other words, you can keep a fully operational farm into production using computer resources, located in a data center which is not affected by the event.

SharePoint Server 2016 and SQL Server 2014 with Service Pack 1 (SP1) or SQL Server 2016, and SharePoint 2013 and SQL Server 2008 R2 with Service Pack 1 (SP1) or SQL Server 2012 offers configuration and content recovery options that can perform the Recovery Time Objective (RTO) and Recovery Point Objective (RPO) that are needed if there is a disaster in your business.

Overview – Disaster Recovery Strategy for SharePoint

In general, the disaster recovery strategy for a SharePoint Server farm must be efficient so that it can fulfill your organization's business requirements these are Recovery Time Objective (RTO) and Recovery Point Objective (RPO). RTO and RPO requirements are extracted by observing the downtime cost to the organization if there is a disaster.

The Downtime cost varies majorly between and within organizations, mainly due to the distinctive belongings of downtime. Commonly, the Business size is the main factor. Though there are many other factors. The process of setting a measure is finding the nature and implications of the failure. Thus, a failure of a critical application may result in the following types of losses:

  • There may be a loss of service of the application. The impact of downtime varies according to the application and the business.
  • There may be a loss of data. The potential loss of data is because of system outage can have serious legal and financial impact.

In maximum situations, the SharePoint products are only the application which is recovered when the data center is shutdown that is like a disaster. Despite this let's concentrate on the ways to recover your SharePoint Server 2016 farm at another location.

Despite the type and scale of a disaster, recovery includes the use of a standby data center by which you can also recover the farm.

Also Read: Common Reasons for Corruption in SharePoint Server

Recovery Options in Standby Data Center

The Standby data centers are needed when you are unable to recover the local redundant systems and backups due to the outage at the primary data center. The time and immediate action for replacement farm up and running at a different location is often known as a hot, warm, or cold standby. These farm recovery data centers are as follows:

  • Cold standby: A secondary data center that can supply availability within hours or days.
  • Warm standby: A secondary data center that can supply availability within minutes or hours.
  • Hot standby: A secondary data center that can provide availability within seconds or minutes.

Cold Standby Recovery Strategy

In this type of strategy, recovery is done by setting up a new farm at a new location, (preferably by using a scripted deployment), and restoring backups. Secondly, you can recover by restoring the farm using a backup solution like System Center 2016 – Data Protection Manager (DPM) or System Center 2012 – Data Protection Manager (DPM). The System Center Data Protection Manager protects your data at the computer operating system level and helps you restore each server individually.

Demerit: It is the slowest option to recover.

Warm Standby Recovery Strategy

In this disaster recovery scenario, you can create a warm standby environment by forming a duplicate farm at the substitute data center and make sure that it is updated regularly by using full and incremental backups of the primary farm.

Demerit: It can be very expensive and time-consuming to maintain.

Virtual Warm Standby Environments Solution

It offers a workable and cost-effective option for a warm standby recovery solution. So, you can develop virtual images of the production servers and ship virtual images to the standby data center. Ensure, that the virtual images are created are sufficient to give the level of farm configuration and content freshness that you should have for recovering the farm. Moreover, at the secondary location, there should be an accessible environment in which you can easily configure and connect the images for the re-creation of the farm environment.

Hot Standby Recovery Strategy

In this recovery scenario, first, you set up a failover farm in the standby data center so that it can undertake production operations immediately after the primary farm goes offline. The characteristic of an environment which have separate failover farm should be followed:

  1. You should maintain a separate configuration database and the SharePoint Central Administration website content database on the failover farm.
  2. Do all customizations must be located on both farms.
  3. The operating system, SQL Server, and SharePoint Server software updates must be used for both farms, for maintaining a consistent configuration in both farms.
  4. You can copy content databases of SharePoint Server to the failover farm by applying asynchronous mirroring, asynchronous commit on an availability group replica, or log-shipping.

Azure Resource Group Documentation

Demerit: It can be very expensive for both, configure and maintain.

Note:

The SQL Server mirroring is only used to copy databases to a single mirror server, but you can log-ship to multiple secondary servers. It is recommended that you should ignore this feature in new development work. Plan to change applications that currently use this feature.

The availability of network bandwidth and latency are main considerations when you are using a failover approach for disaster recovery. For this, you should consult with your SAN vendor to determine whether you can use SAN replication or another supported mechanism to provide the hot standby level of availability across data centers.

Redundant Service Application

The services which can be run cross-farm, for these you run a separate services farm that can be obtained from both the primary and the secondary data centers.

In case, services that cannot be run cross-farm, to give availability for the services farm itself, the strategy for providing redundancy across data centers for a service application changes. The condition required for this strategy to be employed depends on whether:

  • There should be a business value in running the service application in the disaster recovery farm when it is not being used.
  • The databases linked with the service application can be log-shipped, asynchronously mirrored, or replicated using asynchronous commit.
  • The service application should run against read-only databases.

Requirements of System for Recovery

The systems must fulfill the following minimum requirements:

  • Check operating system version and all updates.
  • SQL Server versions and all updates.
  • SharePoint Server versions and all updates.

SharePoint Failover Disaster Recovery Farm

Despite, of above requirements, farm recovery time will also be affected by the availability of facilities and infrastructure components. Ensure that the following requirements are also meeting:

  • The power, cooling, network, directory, and SMTP are redundant.
  • Select a switching mechanism; whether DNS or hardware load balancing, are sufficient to meet your needs.

Alternative Solution

Sharepoint Failover Farm Group

After having a discussion on SharePoint Disaster Recovery for SharePoint 2016 it seems that you should have sound technical knowledge. So, there is an alternate solution Aryson SharePoint Server Recovery. It is an advanced SharePoint Server Recovery tool is capable to repair SharePoint database which is corrupt or inaccessible due to various reasons. It can restore SharePoint Server data like triggers, functions, rules, lists, documents, etc.

Choose A Disaster Recovery Strategy For SharePoint Server ..

Realted Post





broken image