針對 SharePoint Server 災害復原規劃 SQL Server Always On 和 Microsoft AzurePlan for SQL Server Always On and Microsoft Azure for SharePoint Server Disaster Recovery

使用 SQL Server 2014 和 SQL Server 2016 Always On 可用性群組與 Microsoft Azure,為您的內部部署 SharePoint Server 2016 和 SharePoint Server 2013 伺服器陣列建立混合式災害復原環境。本文說明如何設計和實作本解決方案。Use SQL Server 2014 and SQL Server 2016 Always On Availability Groups and Microsoft Azure to create a hybrid disaster-recovery environment for your on-premises SharePoint Server 2016 and SharePoint Server 2013 farm. This article describes how to design and implement this solution.

本文中的解決方案適用於下列項目:The solution in this article applies to the following:

SharePoint Server 2013SharePoint Server 2013

  • Microsoft AzureMicrosoft Azure

  • SQL Server 2014 EnterpriseSQL Server 2014 Enterprise

  • Windows Server 2012 R2 DatacenterWindows Server 2012 R2 Datacenter

SharePoint Server 2016 企業版SharePoint Server 2016 Enterprise

  • SQL Server 2014 Service Pack 1 (SP1)SQL Server 2014 with Service Pack 1 (SP1)

  • SQL Server 2016 Enterprise EditionSQL Server 2016 Enterprise edition

  • Windows Server 2012 R2Windows Server 2012 R2

  • Windows Server 2016 Datacenter EditionWindows Server 2016 Datacenter edition

Acknowledgments: 這個 SharePoint Server 災害復原解決方案是由 Tejinder Rai (MCS) 完成設計、測試和寫入的結果。這個解決方案會結合 Microsoft 最佳作法與可提供實務、真實世界的顧客體驗。David Williams 和 Matthew Robertshaw 也為這篇文章做了很大的貢獻,他們致力於 SQL Server 容錯移轉自動化和復原測試。Acknowledgments: This SharePoint Server disaster recovery solution is the result of the design, testing, and writing done by Tejinder Rai (MCS). This solution combines Microsoft best practices with hands-on, real world customer experiences. David Williams and Matthew Robertshaw also made significant contributions to this article by their work with SQL Server failover automation and recovery testing.

SharePoint Server 的混合式災害復原簡介Introduction to hybrid disaster recovery for SharePoint Server

設定適合的災害復原環境是昂貴且非常複雜的程序。需要仔細規劃以部署及測試符合您業務目標的解決方案,讓您的生產環境和應用程式再次提升和執行。Setting up a suitable disaster recovery environment can be an expensive and very complicated process. It requires careful planning to deploy and test a solution that meets your business goals for getting your production environment and applications up and running again.

談到災害復原,SharePoint Server 會升起複雜性的障礙,需要仔細規劃、設計和測試。您必須考量的一些條件約束是 SQL Server 針對可用性群組複本支援的不同類型容錯移轉,以及數個 SharePoint 資料庫不支援非同步認可複本的因素,和復原這些特殊案例所需的特殊處理。When it comes to disaster recovery, SharePoint Server raises the bar for complexity and the need for careful planning, design, and testing. Some of the constraints that you have to consider are the different types of failover that SQL Server supports for Availability Group replicas, as well as the fact that several SharePoint databases don't support asynchronous commit to a replica, and special handling is required to recover these special cases.

SharePoint Server 搜尋復原SharePoint Server Search recovery

SharePoint 搜尋是在災害案例中復原時需要不同方法和特殊技術的其中一個案例。這是因為如果您使用 Always On 可用性群組搭配非同步認可至次要複本,則無法針對搜尋索引和檔案系統維護資料庫逼真度。SharePoint Search is one of the cases that requires a different approach and special techniques for recovery in a disaster scenario. This is because you can't maintain database fidelity for the search index and file system if you use Always On Availability Groups with asynchronous commit to a secondary replica.

請務必了解在 SharePoint Server 伺服器陣列中搜尋的四個可用災害復原選項。每個選項各有其利弊得失,最佳選項是由商務持續性和復原需求驅動。如需支援選項的詳細資訊,選項包括復原公用雲端裝載之伺服器陣列中搜尋服務的混合式選項,請參閱<嚴重損壞復原最佳作法及 SharePoint 2016 搜尋的策略>。It is important to understand the four available disaster recovery options for Search in a SharePoint Server farm. Each option has its pros and cons, and the best option is driven by business continuity and recovery requirements. For more information about the supported options, which include a hybrid option for recovering the Search service in a farm hosted in a public cloud, see Disaster recovery best practices and strategies for SharePoint 2016 search.

災害復原準則Disaster recovery criteria

在雲端技術問世以前,組織必須設定及維護次要資料中心,作為在發生災害時可以執行任務關鍵系統的備用環境。建立及操作次要資料中心的相關成本,讓許多組織對於為 SharePoint 設定災害復原環境望之卻步。Before the availability of cloud technologies, organizations had to set up and maintain a secondary data center as a standby environment that could run mission critical systems if there was a disaster. The costs associated with creating and operating a secondary data center prevented many organizations from setting up a disaster recovery environment for SharePoint.

雲端基礎結構和平台服務的可用性與成熟度,讓 Microsoft Azure 成為操作次要資料中心以外的一個可行且符合成本效益的替代方式。The availability and maturity of cloud infrastructure and platform services make Microsoft Azure a viable and cost effective alternative to operating a secondary data center.

除了次要資料中心相關的基本成本之外,公司還必須判斷關鍵系統和公司資料的復原需求。復原需求可以藉由回答以下兩個問題來判斷:In addition to the basic costs associated with a secondary datacenter, businesses also need to determine recovery requirements for critical systems and corporate data. Recovery requirements are determined by answering the following two questions:

  • 在公司遭受巨大損失之前,我們可以離線多久時間?例如,這些損失可能是收入、損毀的商務關係或可信度。How long can we be offline before the business suffers significant losses? For example, these losses could be revenue, damaged business relationships, or credibility.

  • 在公司遭受巨大損失之前,我們可以損失多少資料?除了離線範例之外,某些部門完全是由資料驅動,並且具有相依性。How much data can we lose before the business suffers significant losses? In addition to the offline examples, some sectors are totally data driven and dependent.

在災害復原世界中,這些準則量化為復原時間目標 (RTO) 和復原點目標 (RPO)。In the disaster recovery world these criteria are quantified as Recovery Time Objectives (RTOs) and Recovery Point Objectives (RPOs).

注意

相關的目標即為目標復原層級 (RLO)。是定義您必須能復原資料之精確度的目標,例如您必須能復原整個伺服器陣列、Web 應用程式、網站集合、網站、清單或文件庫,或項目。如需詳細資訊,請參閱在 SharePoint Server 中規劃備份和修復A related objective is Recovery Level Objective (RLO). This objective defines the granularity with which you must be able to recover data—whether you must be able to recover the whole farm, web application, site collection, site, list or library, or item. For more information, see Plan for backup and recovery in SharePoint Server.

災害復原解決方案的成本與這些目標息息相關,事實上,RTO 和 RPO 越好,成本越高。目標和成本層級也會決定您選擇的復原環境。三種基本災害復原環境的產業術語是:冷待命、暖待命和熱待命。根據業務部門不同,有各種套裝。The cost of a disaster recovery solution is tied to these objectives—the reality is that better RTO and RPO cost more. The objective and cost level also determine the recovery environment you choose. The industry terminology for three basic disaster recovery environments are: Cold Standby, Warm Standby, and Hot Standby. There are variations of course, depending on the business sector.

如需災害復原解決方案的詳細資訊,請參閱 SharePoint Server 的高可用性與災害復原概念選擇 SharePoint Server 的災害復原策略For more information about disaster recovery solutions, see High availability and disaster recovery concepts in SharePoint Server and Choose a disaster recovery strategy for SharePoint Server.

本文提供架構,您可以用來為 SharePoint Server 部署混合式災害復原解決方案。This article provides a framework that you can use to deploy a hybrid disaster recovery solution for SharePoint Server.

這篇文章沒有的項目What's not in this article

下列主題不在這篇文章的範圍內:The following topics are out of scope for this article:

  • 建立商務持續性和相關聯的災害復原計劃。Creating a business continuity and associated disaster recovery plan.

  • RTO 和 RPO 的服務層級需求。Service level requirements for RTO and RPO.

  • 根據服務層級需求的成本評估。Cost assessment based on service level requirements.

  • 下列作業的詳細步驟:Detailed steps for the following:

    • 設定 Windows Server 容錯移轉叢集 (WSFC) 叢集Configuring a Windows Server Failover Cluster (WSFC) cluster

    • 佈建 Azure 環境 (儲存體帳戶、虛擬網路、雲端服務、可用性設定組和虛擬機器)Provisioning an Azure environment (storage accounts, virtual networks, cloud services, availability sets, and virtual machines)

    • 設定從內部部署伺服器陣列到 Azure 復原環境的 VPN 通道Configuring a VPN tunnel from on-premises farm to Azure recovery environment

災害復原解決方案說明和架構Disaster recovery solution description and architecture

我們的混合式解決方案會使用在北美地區提供跨大陸備援的拓撲。下列測試伺服器陣列會在兩個位置部署:Our hybrid solution uses a topology that provides cross-continental redundancy in North America. The following test farms are deployed in two locations:

  • 在 Redmond, WA (西岸) 執行的內部部署生產伺服器陣列。An on-premises production farm running in a datacenter in Redmond, WA (West coast).

  • 在 Microsoft Azure 上部署的復原伺服器陣列。此伺服器陣列裝載在美國東部的資料中心。此伺服器陣列設定為暖待命復原環境。A recovery farm deployed on Microsoft Azure. This farm is hosted in a datacenter in the Eastern part of the United States. This farm is set up as a warm standby recovery environment.

我們說明的解決方案會使用 SQL Server Always On 可用性群組作為提供高可用性與災害容錯移轉復原的端對端解決方案。除了在生產環境中提供高可用性之外,SQL Server Always On 還會改進 RTO,因為次要資料中心的 SQL Server 執行個體包含來自主要資料中心的資料庫複本。The solution we describe uses SQL Server Always On Availability Groups as an end-to-end solution that provides high availability and disaster failover recovery. In addition to providing high availability in a production environment SQL Server Always On improves RTO because the SQL Server instances in the secondary datacenter contain a replica of the databases from the primary datacenter.

我們的測試環境和條件是設計用來表示主流客戶建置的 SharePoint 生產伺服器陣列和災害復原解決方案類型。Our test environment and conditions are designed to represent the type of SharePoint production farm and disaster recovery solution that mainstream customers are building.

邏輯架構Logical architecture

下圖 (圖 1) 顯示這個方案的邏輯架構,並且反白顯示在內部部署和 Azure 中使用可用性群組複本。The next illustration (Figure 1) shows the logical architecture for this solution and highlights the use of Availability Group replicas on-premises and in Azure.

圖 1 混合式環境的邏輯架構Figure 1 Logical architecture for hybrid environment

此圖顯示 SharePoint Server 2013 混合式嚴重損壞修復的邏輯架構。如需詳細資料,請閱讀下列段落。

詳細架構Detailed architecture

下圖 (圖 2) 顯示內部部署測試伺服器陣列的詳細架構。伺服器陣列已設定為具有企業搜尋的高可用性伺服器陣列。The next figure (Figure 2) shows the detailed architecture for the on-premises test farm. The farm is configured as a highly available farm with enterprise search.

注意

所有圖表標籤都是根據我們用來建置和測試這個災害復原案例的命名慣例。它們提供文章的參考點。All the diagram labels are based on the naming convention we used to build out and test this disaster recovery scenario. They provide reference points for the article.

圖 2 內部部署生產伺服器陣列Figure 2 On-premises production farm

此圖顯示 SharePoint Server 2013 混合式嚴重損壞修復的詳細內部部署架構。如需詳細資訊,請閱讀以下段落。

下圖 (圖 3) 顯示在 Azure 中部署之暖待命伺服器陣列的拓撲。The next figure (Figure 3) shows the detailed topology of the warm standby farm deployed in Azure.

圖 3 暖待命復原伺服器陣列Figure 3 Warm standby recovery farm

此圖表顯示 Azure 環境的 SharePoint Server 2013 混合式嚴重損壞修復的詳細修復架構。如需詳細資料,請閱讀下列段落。

對於這個 SharePoint Server 災害復原解決方案您需要什麼項目What you need for this SharePoint Server disaster recovery solution

使用下列需求作為開始規劃部署這個災害復原解決方案的指南。Use the following requirements as a guide to start planning the deployment of this disaster recovery solution.

Infrastructure and general configurationInfrastructure and general configuration

下表是內部部署伺服器陣列和復原伺服器陣列之基礎結構和一般組態需求的摘要:The following list is a summary of the infrastructure and general configuration requirements for the on-premises farm and the recovery farm:

  • 兩個 SharePoint Server 伺服器陣列。在主要資料中心的生產伺服器陣列和使用 Azure 作為次要資料中心的暖待命伺服器陣列。使用 Azure 的另一個好處是,您不必擔心為這兩個伺服器陣列使用相同的硬體。Two SharePoint Server farms. A production farm in your primary datacenter and a warm standby farm that uses Azure as the secondary datacenter. An added benefit to using Azure is that you don't have to worry about using identical hardware for both farms.

  • 每個伺服器陣列在這兩個資料中心都是在線上。Each farm is online in both datacenters.

  • 軟體版本和修補程式層級。這兩個伺服器陣列都使用以下應用程式的相同軟體版本和修補程式層級:Software versions and patch levels. Both farms use the same software version and patch level for:

    • Windows Server 2012 R2 或 Windows Server 2016Windows Server 2012 R2 or Windows Server 2016

    • SQL Server 2014 或 SQL Server 2016SQL Server 2014 or SQL Server 2016

    • SharePoint Server 2016 或 SharePoint Server 2013SharePoint Server 2016 or SharePoint Server 2013

  • 這兩個伺服器陣列都設定為使用用來管理 SharePoint 的相同服務帳戶。Both farms are configured to use the same service accounts for administering SharePoint.

  • 內容資料庫和服務應用程式資料庫是跨一或多個 SQL Server 可用性群組散佈。Content databases and service application databases are distributed across one or more SQL Server Availability Groups.

  • 針對內部部署環境中的複本使用同步認可模式。這是典型的 SharePoint 伺服器陣列高可用性組態,因為它支援自動容錯移轉和最小化資料損失。Use synchronous commit mode for the replicas in the on-premises environment. This is the typical high availability configuration for a SharePoint farm because it supports automatic failover and minimizes data loss.

  • 針對復原環境中的複本使用非同步認可模式。雖然不支援自動容錯移轉,但是資料輸送量通常比較好,當生產與復原伺服器陣列之間的距離相當遠時,這會是非常重要的因素。Use asynchronous commit mode for the replica in the recovery environment. Although automatic failover isn't supported, data throughput is usually better which can be a very important factor when the distance between the production and recovery farms is significant.

    注意

    在某些情況下,對復原環境中複本的同步認可已經過測試及實作,因為輸送量與對復原複本使用非同步認可時相同。不過,這並未被廣泛接受或建議。There are cases where synchronous commit to a replica in a recovery environment have been tested and implemented because throughput is the same as using asynchronous commit to the recovery replica. However, this is not broadly accepted or recommended.

  • 每個伺服器陣列都有它自己的服務應用程式,在兩個環境之間有同步處理的資料庫。因為唯讀資料庫是用於災害復原伺服器陣列中的服務應用程式,所以在生產伺服器陣列容錯移轉時,不需要重新佈建服務應用程式。Each farm has its own service applications that have synchronized databases between the two environments. Because read-only databases are used for service applications in the disaster recovery farm, service applications do not need to be re-provisioned when the production farm fails over.

  • 搜尋具有災害復原執行個體中唯讀資料庫的編目。如果需要這樣做,您必須為復原伺服器陣列設定不同的搜尋服務應用程式。如需詳細資訊,請參閱SharePoint 資料庫支援的高可用性和災害復原選項Search crawling with Read-Only databases in the disaster recovery instance. If this is required you need to configure a separate Search Service Application for the recovery farm. For more information, see Supported high availability and disaster recovery options for SharePoint databases.

提示

可行時,隨時隨地使用自動化。已編寫指令碼的部署和組態能確保組態一致性,並且減少由於輸入命令或透過使用者介面來設定伺服器陣列所造成的錯誤。Use automation wherever and whenever possible. Scripted deployment and configuration ensures configuration consistency and reduces errors caused by typing commands or navigating through the user interface to configure the farm.

兩個伺服器陣列都需要的強制組態需求Mandatory configuration requirements for both farms

部署這篇文章所述的災害復原解決方案需要下列技術:The following technologies are needed to deploy the disaster recovery solution described in this article:

  • Windows Server 2012 R2 或 Windows Server 2016Windows Server 2012 R2 or Windows Server 2016

  • SharePoint Server 2016 或 SharePoint Server 2013 Service Pack 1 和 2014 年 5 月累積更新SharePoint Server 2016 or SharePoint Server 2013 with Service Pack 1 and the May 2014 cumulative update

  • SQL Server 2014 或 SQL Server 2016SQL Server 2014 or SQL Server 2016

  • 主要資料中心和 Azure 中復原伺服器陣列之間的安全連線。我們使用 VPN 連線,但是如果您的區域可以使用 ExpressRoute 的話,請考慮使用它。A secure connection between the primary data center and the recovery farm in Azure. We used a VPN connection but if ExpressRoute is available in your area consider using it.

了解資料庫需求:SQL Server AlwaysOn 和 SharePoint ServerUnderstand database requirements: SQL Server Always On and SharePoint Server

主要資料中心會利用可用性群組同步認可複本,以達成主要伺服器陣列中的高可用性。次要資料中心必須利用非同步認可複本。這是因為主要和次要資料中心之間的網路延遲。請務必監視測試期間災害復原伺服器陣列之重新執行記錄緩衝區的延遲。The primary datacenter will utilize availability group synchronous-commit replicas to achieve high availability in the primary farm. The secondary datacenter must utilize asynchronous-commit replicas. This is due to the latency on the network between the primary and secondary datacenters. It is important to monitor the latency of replaying log buffers to the disaster recovery farm during testing.

相依性、必要條件以及最佳作法Dependencies, prerequisites, and best practices

請先檢閱下列相依性、必要條件及最佳作法,再建置測試伺服器陣列。Review the following dependencies, prerequisites, and best practices before building out the test farms.

Windows Server 容錯移轉叢集 (WSFC) 叢集Windows Server Failover Clustering (WSFC) cluster

WSFC 叢集會跨越兩個資料中心。內部部署資料中心和修復環境中的所有節點都屬於相同的 WSFC 叢集。The WSFC cluster will span two datacenters. All the nodes in the on-premises datacenter and the recovery environment belong to the same WSFC cluster.

SharePoint 的 SQL Server 組態SQL Server configuration for SharePoint

  • 建立 SQL Server 磁碟區以分隔 SQL 資料庫、伺服器陣列資料庫、資料庫記錄檔、tempdb 資料庫和 tempdb 資料庫記錄檔。Create SQL Server volumes to separate the SQL databases, farm databases, database log files, tempdb databases, and tempdb database log files.

  • 依據讀取/寫入速度在磁碟區上散佈伺服器陣列資料庫。使用最快到最慢來設定優先順序,下列散佈是典型:Distribute the farm databases over the volumes according to read/write speed. Using fastest to slowest to set priorities, the following distribution is typical:

    • Tempdb 資料與交易記錄檔Tempdb data and transaction log files

    • 資料庫交易記錄檔Database Transaction log files

    • 搜尋資料庫檔案Search database files

    • 內容資料庫Content databases

  • 設定 SQL Server 服務和 SQL 代理程式服務的帳戶。Set up the accounts for the SQL Server service and the SQL Agent service.

當您為 SharePoint 伺服器陣列部署 SQL Server 時,使用下列表格中的組態。Use the configurations in the following table when you deploy SQL Server for the SharePoint farms.

元件Component 設定Settings
連接埠Port
封鎖 UDP 連接埠 1434。Block UDP port 1434.
建議您封鎖 TCP 連接埠 1433,並將預設執行個體使用的連接埠重新指定為不同的連接埠。不過,這不是強制的。 We recommend that you block TCP port 1433, and assign the port that is used by the default instance to a different port. However, this is not mandatory.
請確定要指派至預設執行個體的連接埠號碼不是已註冊的連接埠。請參閱<服務名稱和傳輸通訊協定連接埠號碼登錄>以避免使用已註冊的連接埠。 Make sure that the port number that is to be assigned to the default instance is not in the registered ports. Refer to Service Name and Transport Protocol Port Number Registry to avoid using the registered port.
請確定您遵循<設定 SharePoint Server 的 SQL Server 安全性>中的安全性指引。Ensure that you follow the security guidance in Configure SQL Server security for SharePoint Server.
防火牆規則:針對 SQL Server 執行個體使用的非預設連接埠,建立新的輸入規則。Firewall Rules: Create new Inbound rules for the non-default port used by the SQL Server instance.
隱藏執行個體:從用戶端電腦隱藏 SQL Server 執行個體。Hide instance: Hide the SQL Server instance from client computers.
鎖定記憶體分頁Lock pages in memory
授與 SQL Server 服務帳戶權限,以鎖定記憶體分頁。如需詳細資訊,請參閱<啟用鎖定記憶體分頁選項 (Windows)>和<伺服器記憶體伺服器組態選項>。 Grant the SQL Server service account permissions to lock pages in memory. For more information, see Enable the Lock Pages in Memory Option (Windows) and Server Memory Server Configuration Options.
停用自動建立統計資料Disable Auto-create statistics
Do not 在 SQL Server 上啟用自動建立統計資料。系統不支援 SharePoint Server。如需詳細資訊,請參閱 針對 SharePoint 伺服器陣列 SQL Server 的最佳作法Do not enable auto-create statistics on SQL Server. This is not supported for SharePoint Server. For more information, see Best practices for SQL Server in a SharePoint Server farm.
設定平行處理原則的最大程度Set Max Degree of Parallelism
在主控 SharePoint Server 資料庫的 SQL Server 執行個體中,將平行處理原則的最大程度 (MAXDOP) 設為 1。Set the max degree of parallelism (MAXDOP) to 1 in SQL Server instances that host SharePoint Server databases.
Note: SQL Server 上的 SharePoint Server 安裝會因為設計而失敗,除非安裝程式帳戶具有變更它的權限。Note: SharePoint Server installation on SQL Server will fail by design unless the installer account has permission to change it.
如需詳細資訊,請參閱針對 SharePoint 伺服器陣列 SQL Server 的最佳作法For more information, see Best practices for SQL Server in a SharePoint Server farm.
追蹤旗標Trace Flags
新增追蹤旗標 1222 (傳回參與死結的資源和鎖定類型) 和 3226 (隱藏 SQL 錯誤記錄中的記錄備份項目)。Add the trace flags 1222 (return resources and types of locks participating in a deadlock) and 3226 (suppress log backup entries in the SQL error log).
DBCC TRACEON (1222,-1)DBCC TRACEON (1222,-1)
DBCC TRACEON (3226,-1)DBCC TRACEON (3226,-1)
SQLAgent 作業歷程記錄SQLAgent Job History
請確定 SQLAgent 有以下設定:(Jobhistory_max_rows = 50000 and Jobhistory_max_rows_per_job = 10000)。Make sure that SQLAgent has these settings, (Jobhistory_max_rows = 50000 and Jobhistory_max_rows_per_job = 10000).
最低記憶體Minimum memory
最低記憶體 = 512 Mb。(不過,這是根據我們的測試組態,可能不適用於您的 SQL Server 安裝,因此您應該計算您的需求。)如需詳細資訊,請參閱<伺服器記憶體伺服器組態選項>和<設定每個查詢最低記憶體伺服器組態選項>。 Min Memory = 512 Mb. (However, this is based on our test configuration and may not apply to your SQL Server installation so you should calculate your requirement.) For more information, see Server Memory Server Configuration Options and Configure the min memory per query Server Configuration Option.
最大記憶體Maximum memory
根據下列公式設定 SQL Server 的最大記憶體限制:Set the maximum memory limit for SQL Server based on the following formula:
總伺服器 RAM (GB) - 4 GB = [最大伺服器記憶體]Total Server RAM (GB) - 4 GB = max server memory
如需詳細資訊,請參閱<伺服器記憶體伺服器組態選項>。For more information, see Server Memory Server Configuration Options.
DNS 別名DNS aliases
我們建議您為所有 SQL Server 執行個體建立 DNS 別名。這有助於簡化維護,例如,更方便將資料庫移至另一部伺服器。例如,Azure 災害復原資料中心的 SharePoint 伺服器陣列,直接連線至 SQL Server 執行個體。您應該建立 DNS 別名,而不要直接使用執行個體名稱設定伺服器陣列。 We recommend that you create DNS aliases for all SQL Server instances. This helps to simplify maintenance, such as to make it easier to move databases to another server. For example, the SharePoint farm in the Azure disaster recovery datacenter, connects directly to the SQL Server instance names. You should create a DNS alias rather than configure the farm with the instance names directly.
附註: 用戶端別名與 DNS 別名應該相符,以確保未使用 SQL 用戶端別名的用戶端也可以連絡 SQL 伺服器。Note: The client alias and DNS alias should match to ensure clients which don't use SQL client aliases can also contact SQL servers.
如需詳細資訊,請參閱針對 SharePoint 伺服器陣列 SQL Server 的最佳作法For more information, see Best practices for SQL Server in a SharePoint Server farm.
資料庫定序Database collation
Latin1_General_Cl_AS_KS_WSLatin1_General_Cl_AS_KS_WS
SQL Server 資料庫定序必須設定為不區分大小寫,區分重音符號、區分「假名」和區分全半形。這是為了確保與 Windows 作業系統一致的檔案名稱獨特性。The SQL Server database collation must be configured for case-insensitive, accent-sensitive, kana-sensitive, and width-sensitive. This is to ensure file name uniqueness consistent with the Windows operating system.

設計需求及考量Design requirements and considerations

Always On 可用性群組一部分的每個 SQL Server 執行個體也必須是相同 WSFC 叢集的一部分。可用性群組有主要複本 (具有最新的資料) 和次要複本 (接收來自主要複本的更新)。每個可用性複本都必須位於單一 Windows Server 容錯移轉叢集 (WSFC) 叢集的不同節點上。單一 Windows Server 容錯移轉叢集一部分的所有 SQL Server 節點,需要有自己的儲存體,這一點與 SQL Server 容錯移轉叢集執行個體 (FCI) 不同。Each SQL Server instance that is part of an Always On Availability Group must also be part of the same WSFC cluster. An Availability Group has a primary replica, which has the most current data, and secondary replicas that receive updates from the primary replica. Each availability replica must reside on a different node of a single Windows Server Failover Clustering (WSFC) cluster. All of the SQL Server nodes, which are part of a single Windows Server Failover Cluster, require their own storage, unlike SQL Server Failover Cluster Instances (FCIs).

如需可用性群組的必要條件、限制、建議和一般使用方式的詳細資訊,請參閱:For more information about prerequisites, restrictions, recommendations, and general usage for availability groups, see:

下圖 (圖 4) 顯示我們用於 SharePoint 資料庫的可用性群組複本基礎結構。The next figure (Figure 4) shows the Availability Group replica infrastructure that we used for the SharePoint databases.

圖 4 可用性群組複本基礎結構Figure 4 Availability Group replica infrastructure

此影像顯示如何在 AlwaysOn 可用性群組上發佈 SharePoint 資料庫。如需詳細資料,請閱讀以下段落。

在 圖 4 所示的基礎結構中,常見作法是讓資料庫伺服器位於個別子網路上的復原環境,當設定 WSFC 與可用性群組接聽程式時必須列入考慮。In the infrastructure shown in Figure 4, a common practice is to have the database servers in the recovery environment on a separate subnet, which must be taken into account when configuring WSFC and Availability Group listeners.

您也必須規劃並測試內部部署伺服器陣列與復原環境之間的網路延遲。複本之間的延遲會影響您的復原點目標 (RPO)。You also need to plan for and test network latency between the on-premises farm and the recovery environment. The latency between replicas will have an impact on your Recovery Point Objective (RPO).

最後,請考慮在各自 Azure 雲端服務中的復原環境佈建資料庫伺服器,也就是建置測試環境的方式。雲端服務可讓您群組伺服器角色,使您可以將 Azure VM 當作單一實體來管理。如需詳細資訊,請參閱<我該選擇雲端服務還是其他服務?>。Finally, think about provisioning the database servers in the recovery environment in their own Azure cloud service, which is how the test environment was built. Cloud services lets you group server roles so you can manage Azure VMs as a single entity. For more information, see Should I choose cloud services or something else?.

就像 SharePoint Server 一樣,先行設計架構比較簡單,而不是後來再重新設計 Azure 的平台服務。Like SharePoint Server, it is easier to design the architecture up front, rather than having to redesign Azure's platform services later.

可用性群組認可模式和容錯移轉類型Availability group commit modes and failover types

請務必了解認可模式會如何影響每個可用性群組組態的不同類型容錯移轉,因為這會影響伺服器陣列復原。下表是來自 SQL Server 文件。下表總結了在不同可用性和容錯移轉模式下,支援哪些形式的容錯移轉。針對每個配對,有效的可用性模式和容錯移轉模式,是由主要複本模式加上一或多個次要複本模式的交集來決定。如需詳細資訊,請參閱<容錯移轉及容錯移轉模式 (AlwaysOn 可用性群組)>。It is important to understand how commit modes affect the different types of failover for each Availability Group configuration because this will affect farm recovery. The following table is from the SQL Server documentation. This table summarizes which forms of failover are supported under different availability and failover modes. For each pairing, the effective availability mode and failover mode is determined by the intersection of the modes of the primary replica plus the modes of one or more secondary replicas. For more information, see Failover and Failover Modes (AlwaysOn Availability Groups).

容錯移轉類型Failover type 同步認可模式與自動容錯移轉模式Synchronous-commit mode with automatic-failover mode 同步認可模式與手動容錯移轉模式Synchronous-commit mode with manual-failover mode 非同步認可模式Asynchronous-commit mode
Automatic failoverAutomatic failover
Yes
No
No
Planned manual failoverPlanned manual failover
Yes
Yes
No
Forced failoverForced failover
是 (1)Yes (1)
Yes
Yes

(1) 如果您在已同步的次要複本中發出強制容錯移轉命令,次要複本的行為與手動容錯移轉相同。(1) If you issue a forced failover command on a synchronized secondary replica, the secondary replica behaves the same as for a manual failover.

資料庫在容錯移轉期間無法使用的時間量取決於容錯移轉類型及其原因類型。The amount of time that the database is unavailable during a failover depends on the type of failover and its cause.

SharePoint 資料庫支援的高可用性和災害復原選項Supported high availability and disaster recovery options for SharePoint databases

本節中的表格總結了 SharePoint Server 資料庫支援的高可用性和災害復原選項。如需詳細資訊,請參閱 SharePoint 資料庫支援的高可用性和災害復原選項The tables in this section summarize the supported high availability and disaster recovery options for SharePoint Server databases. For more detailed information, see Supported high availability and disaster recovery options for SharePoint databases.

資料庫名稱Database name 高可用性 (同步支援)High Availability (Synchronous Support) 災害復原 (非同步支援)Disaster Recovery (Asynchronous Support)
SharePoint ConfigSharePoint Config
Yes
No
SharePoint Admin ContentSharePoint Admin Content
Yes
No
State ServiceState Service
Yes
No
WSS Content XWSS Content X
Yes
Yes

下表列出 SharePoint 服務應用程式資料庫。The following table lists the SharePoint service application databases.

資料庫名稱Database name 高可用性 (同步支援)High Availability (Synchronous Support) 災害復原 (非同步支援)Disaster Recovery (Asynchronous Support)
App ManagementApp Management
Yes
Yes
Business Connectivity ServicesBusiness Connectivity Services
Yes
Yes
受管理的中繼資料Managed Metadata
Yes
Yes
PerformancePointPerformancePoint
Yes
Yes
PowerPivotPowerPivot
Yes
Yes
Project (僅限 SharePoint Server 2013)Project (SharePoint Server 2013 only)
Yes
Yes
Secure StoreSecure Store
Yes
Yes
Subscription SettingsSubscription Settings
Yes
Yes
Machine Translation ServicesMachine Translation Services
Yes
Yes
UPS ProfileUPS Profile
Yes
Yes
UPS SocialUPS Social
Yes
Yes
UPS SyncUPS Sync
Yes
No
UsageUsage
Yes
No
Word AutomationWord Automation
Yes
Yes

下表列出 SharePoint 搜尋資料庫。The following table lists the SharePoint Search databases.

資料庫名稱Database name 高可用性 (同步支援)High Availability (Synchronous Support) 災害復原 (非同步支援)Disaster Recovery (Asynchronous Support)
Search AdminSearch Admin
Yes
No
Search CrawlSearch Crawl
Yes
No
Search Link StoreSearch Link Store
Yes
No
Search Analytics StoreSearch Analytics Store
Yes
No

以六個階段建置測試伺服器陣列Build out the test farms in six phases

建置 SharePoint 環境有數個階段,該環境會提供 高可用性 (HA) 和災害復原 (DR)。我們將設定內部部署和復原伺服器陣列的步驟組織成下列階段:There are several phases to building out a SharePoint environment which provides High-Availability (HA) and Disaster Recovery (DR). We organized the steps for configuring the on-premises and recovery farms into the following phases:

  1. 建置階段 1:為內部部署環境設定 Windows Server 容錯移轉叢集和 SQL Server Always On。Build phase 1: Configure the Windows Server Failover Cluster and SQL Server Always On for the on-premises environment.

  2. 建置階段 2:安裝和設定 SharePoint Server 來建立內部部署伺服器陣列。Build phase 2: Install and configure SharePoint Server to create the on-premises farm.

  3. 建置階段 3:在復原環境中設定 Windows Server 容錯移轉叢集和 SQL Server。Build phase 3: Configure Windows Server Failover Cluster and SQL Server in the recovery environment.

  4. 建置階段 4:安裝和設定 SharePoint Server 來建立復原伺服器陣列。Build phase 4: Install and configure SharePoint Server to create the recovery farm.

  5. 建置階段 5:完成設定復原端點,並且將資料庫複製到復原伺服器陣列。Build phase 5: Finish configuring the recovery endpoint and replicate databases to the recovery farm.

  6. 建置階段 6:完成設定復原伺服器陣列上的 SharePoint Server。Build phase 6: Finish configuring SharePoint Server on the recovery farm.

在您開始之前先做一些準備Do some preparation before you start

下表列出此災害復原案例的關鍵基礎結構元件。我們已經識別必要條件,並且提供組態指引。The following table lists the key infrastructure components for this disaster recovery scenario. We've identified prerequisites and provided configuration guidance.

基礎結構元件Infrastructure component 附註Notes
網域控制站Domain controller
對於我們的內部部署測試環境,我們已經部署網域控制站,並且建立 corp.adventureworks.com 網域。如果您決定執行概念證明災害復原案例,您可以使用您組織的網域名稱。 For our on-premises test environment we deployed a domain controller and created the corp.adventureworks.com domain. If you decide to run a proof of concept disaster recovery scenario you can use your organization's domain name.
Note: 設定網域之後,我們也會佈建所有 VM,用於伺服器陣列以及將 OS 修補到相同層級。比起分次方法,這讓事情更容易管理。 Note: After we configured the domain, we also provisioned all of the VMs we'd be using for the farm and patched the OS to the same level. This made things more manageable than taking a piecemeal approach.
Windows Server 2012 R2 和 Windows Server 2016 容錯移轉叢集Windows Server 2012 R2 and Windows Server 2016 failover clustering
所設定之每個伺服器陣列伺服器上的 Windows Server 2012 R2 或 Windows Server 2016 是根據最佳作法 (Windows Server 和 SharePoint Server)。如需詳細資訊,請參閱<SQL Server 的 Windows Server 容錯移轉叢集 (WSFC)>。 Windows Server 2012 R2 or Windows Server 2016 on each farm server configured according to best practices (Windows Server and SharePoint Server). For more information, see Windows Server Failover Clustering (WSFC) with SQL Server.
成為叢集節點的每一部伺服器必須有容錯移轉叢集功能,並且已安裝容錯移轉叢集管理 MMC。Every server that will be a cluster node must have the Failover Cluster feature and the Failover Cluster Management MMC installed.
WSFC 仲裁的檔案共用。最佳作法是應該在內部部署網站和復原網站可以存取的第三個網站進行設定。 A file share for the WSFC Quorum. As a best practice this should be configured in a third site that can be accessed by the on-premises site and the recovery site.
記錄並嚴格遵守叢集的一致命名慣例。Document and stick to a consistent naming convention for the cluster.
SQL Server 資料庫組態和 Always On 可用性群組SQL Server database configuration and Always On Availability Groups
SQL Server 2014 或 SQL Server 2016 的設定是根據「相依性、必要條件和最佳作法」中提及的 SharePoint 需求和最佳作法。SQL Server 2014 or SQL Server 2016 configured according to SharePoint requirements and the best practices identified in "Dependencies, prerequisites and best practices".
資料庫使用完整復原模式。如需詳細資訊,請參閱<復原模式 (SQL Server)>。Databases use full recovery model. For more information, see Recovery Models (SQL Server).
SQL Server 執行個體名稱。(我們使用預設執行個體名稱,該名稱在跨所有叢集節點的這個設計中受到支援)。SQL Server instance names. (We used the Default instance name, which is supported in this design across all the cluster nodes).
資料庫的相同檔案路徑和每個 SQL Server 執行個體的記錄檔案位置。我們使用下列磁碟機配置:(針對 SQL 資料庫和 SharePoint 資料庫使用「系統 (L:)」)、(針對 tempdb 資料庫和記錄檔使用「使用者 (S:)」) 和 (針對 SharePoint SQL 備份使用「本機磁碟 (T:)」)。 The same file paths for the database and log file locations for each SQL Server instance. We used the following drive layouts, (System (L:) for SQL databases and SharePoint databases), (User (S:) for tempdb databases and log files), and (Local disk (T:) for SharePoint SQL backups).
記錄並嚴格遵守可用性群組、複本和接聽程式的一致命名慣例。Document and stick to a consistent naming convention for the Availability Groups, the replicas, and the listeners.
網路功能Networking
叢集節點 - 三個靜態 IP 叢集 IP 位址 (兩個用於內部部署伺服器陣列,一個用於復原伺服器陣列)。Cluster nodes - Three static IP Cluster IP addresses (two for the on-premises farm and one for the recovery farm).
可用性群組接聽程式 - 每個接聽程式一個靜態 IP 位址。(我們的測試伺服器陣列使用四個接聽程式。)Availability Group Listeners - A static IP addresses for each listener. (Our test farm used four listeners.)
Microsoft Azure 閘道伺服器Microsoft Azure gateway server
Azure 中的伺服器,為來自內部部署伺服器陣列的 VPN 閘道連線提供端點。已設定有 Active Directory 網域服務 (AD DS) 和 DNS 服務角色,並且指定為測試網域 (corp.adventureworks.com) 的通用類別目錄伺服器。A server in Azure that provides the endpoint for the VPN gateway connection from the on-premises farm. It is configured with the Active Directory Domain Services (AD DS) and DNS Services roles and is designated as a global catalog server for the test domain (corp.adventureworks.com).
有災害時,這部伺服器可以成為主要網域控制站。When there is a disaster this server can become the primary domain controller.
VPN 閘道VPN gateway
主要資料中心與 Windows Azure 訂用帳戶 (會在其中設定災害復原伺服器陣列) 之間設定的站台對站台 VPN 或 ExpressRoute。A site-to-site VPN or ExpressRoute configured between the primary datacenter and the Windows Azure Subscription where the disaster recovery farm will be configured.
如需詳細資訊,請參閱<使用傳統入口網站建立具有站台對站台連線的 VNet (傳統)>和<使用 PowerShell 建立和修改 ExpressRoute 線路 (傳統)>。For more information, see Create a VNet with a Site-to-Site connection using the classic portal (classic) and Create and modify an ExpressRoute circuit using PowerShell (classic).

Microsoft Azure 和復原環境Microsoft Azure and the recovery environment

建置復原環境的第一個步驟是在 Azure 中部署伺服器,然後再建立內部部署伺服器陣列與 Azure 伺服器之間的 VPN 或 ExpressRoute 連線。The first steps in building out the recovery environment are to deploy a server in Azure and then establish a VPN or ExpressRoute connection between the on-premises farm and the Azure server.

Azure Infrastructure as a Service (IaaS) 與使用 Windows Server Hyper-V 虛擬和 System Center Virtual Machine Manager (VMM) 的內部部署私人雲端有許多相似之處。不過,即使是具有在私人雲端中作業方面豐富經驗的 IT 專業人員,也會受阻於這些差異!Azure Infrastructure as a Service (IaaS) has many similarities to an on-premises private cloud that uses Windows Server Hyper-V virtualization and System Center Virtual Machine Manager (VMM). However, even IT professionals with extensive experience working in a private cloud get tripped up by the differences!

附錄中的「附錄」資料工作表會協助您在 Azure 環境中規劃、部署及操作 SharePoint Server 2016。它不會取代 Azure 文件和實務經驗,但是,它可以讓您從 SharePoint 觀點輕易地來看 Azure 世界。如需 Azure 災害復原解決方案的詳細資訊,請參閱<使用 Azure Site Recovery 複寫多層式 SharePoint 應用程式以便進行災害復原>和<什麼是 Site Recovery?>。The Appendix data sheet in the appendix will help you plan, deploy, and operate SharePoint Server 2016 in the Azure environment. It doesn't replace the Azure documentation and hands-on experience, but it will ease you into the Azure world from a SharePoint perspective. For information about Azure disaster recovery solutions, see Replicate a multi-tier SharePoint application for disaster recovery using Azure Site Recovery and Azure Site Recovery.

建置階段 1Build phase 1

此圖顯示建置階段 1 中為內部部署伺服器陣列設定 WSFC 和 AlwaysOn 的步驟

接下來的表格提供建置階段 1 中步驟的詳細資訊。The next table provides more information about the steps in Build phase 1.

步驟Step 附註和指引Notes and guidance
1.設定雙節點 WSFC 叢集1. Configure a two-node WSFC cluster
使用 Windows Server 文章<建立容錯移轉叢集>,來建立雙節點叢集。如需 Windows Server 2016 資訊,請參閱<Windows Server 2016 容錯>。 Use the Windows Server article, Create a Failover Cluster to create a two-node cluster. For Windows Server 2016 information, see Failover Clustering in Windows Server 2016.
2. 設定檔案共用見證2. Configure a file share witness
在 SharePoint 環境中針對 WSFC 的偏好組態是使用檔案共用見證和節點多數。內部部署伺服器陣列中的兩個叢集節點都具有仲裁投票。復原伺服器陣列中的叢集節點沒有投票。 The preferred configuration for WSFC in a SharePoint environment is to use a file share witness and a node majority. Both cluster nodes in the on-premises farm have a quorum vote. The cluster node in the recovery farm doesn't have a vote.
如需詳細資訊,請參閱<設定和管理 Windows Server 2012 容錯移轉叢集中的仲裁>。針對 Windows Server2016,請參閱<部署雲端見證容錯移轉叢集>。 For more information, see Configure and Manage the Quorum in a Windows Server 2012 Failover Cluster. For Windows Server 2016, see Deploy a Cloud Witness for a Failover Cluster.
使用下列 Microsoft PowerShell Cmdlet 來設定檔案共用和節點多數仲裁:Use the following Microsoft PowerShell cmdlet to configure a file share and node majority Quorum:
Set-ClusterQuorum -NodeAndFileShareMajority "\\fileserver\share"
使用下列 PowerShell Cmdlet 來指派投票:Use the following PowerShell cmdlet to assign votes:
(Get-ClusterNode {CLUSTERNODENAME}).NodeWeight=1
使用下列 PowerShell 語法來設定雲端見證:Use the following PowerShell syntax to configure a Cloud Witness:
Set-ClusterQuorum -CloudWitness -AccountName <StorageAccountName> -AccessKey <StorageAccountAccessKey>
3. 在每個 Windows 叢集節點上安裝 SQL Server3. Install SQL Server on each Windows cluster node
在 Windows Server 叢集節點上都安裝 SQL Server。請注意下列事項:Install SQL Server on both Windows Server cluster nodes. Note the following:
Do not 執行容錯移轉叢集的 SQL Server 安裝程式。這些節點不是 SQL 容錯移轉叢集執行個體 (FCI) 叢集的一部分。 Do not run the SQL Server setup program for a failover cluster. These nodes are not part of a SQL Failover Cluster Instance (FCI) Cluster.
請確定每個執行個體的 SQL Server 資料路徑完全相同。Make sure that the SQL Server data paths are exactly the same for each instance.
如需詳細資訊,請參閱<從安裝精靈安裝 SQL Server 2014 (安裝程式)>或<從命令提示字元安裝 SQL Server 2014>。另請參閱<從安裝精靈安裝 SQL Server 2016 (安裝程式)>。 For more information, see Install SQL Server 2014 from the Installation Wizard (Setup) or Install SQL Server 2014 from the Command Prompt. Also, see Install SQL Server from the Installation Wizard (Setup).
4. 啟用 SQL Server AlwaysOn4. Enable SQL Server Always On
使用<啟用和停用 AlwaysOn 可用性群組 (SQL Server)>中的指引來啟用 Always On。使用<啟用和停用 AlwaysOn 可用性群組 (SQL Server)>中的 SQL Server 2016 指引。 Use the guidance in Enable and Disable AlwaysOn Availability Groups (SQL Server) to enable Always On. Use theSQL Server2016 guidance in Enable and Disable Always On Availability Groups (SQL Server).
此表格後面的資料庫群組區段會示範如何邏輯地群組 SharePoint 資料庫,並且將它們對應至不同的可用性群組,以符合災害復原需求和高可用性需求。The database grouping section after this table shows how you can logically group SharePoint databases and map them to different availability groups to meet your disaster recovery requirements as well as your high availability requirements.
5.設定伺服器陣列帳戶安全性5. Configure farm account security
在每個 SQL Server 執行個體為 SharePoint 安裝使用者系統管理員帳戶設定適當的權限。此帳戶必須是 db_owner 角色的成員,並且在安裝及設定期間指派給 securityadmindbcreator SQL Server 安全性角色。 Configure the appropriate permissions in each SQL Server instance for the SharePoint setup user administrator account. This account must be a member of the db_owner role and assigned to the securityadmin and dbcreator SQL Server security roles during setup and configuration.
如需詳細資訊,請參閱<設定 SharePoint Server 的 SQL Server 安全性>和<SharePoint Server 2016 中的帳戶權限及安全性設定>。For more information, see Configure SQL Server security for SharePoint Server and Account permissions and security settings in SharePoint Server 2016.
6.建立可用性群組、Always On 端點和可用性群組接聽程式6. Create availability groups, Always On Endpoints, and Availability Group Listeners
針對同步認可模式的高可用性建立可用性群組。(為資料庫的邏輯容錯移轉以邏輯方式設定可用性群組,是常見的作法)。建立 Always On 端點之後,建立可用性群組接聽程式以啟用與每個可用性群組的用戶端連線。 Create the availability groups for synchronous-commit mode for high availability. (It is common practice to configure the availability groups logically for the logical failover of databases). After you create the Always On Endpoints, create Availability Group listeners to enable client connectivity to each availability group.
Note: 您可以使用暫時資料庫名稱建立可用性群組,因此 SharePoint 可以在伺服器陣列設定時使用接聽程式。這就是資料庫連接字串如何指向接聽程式建立的適當 DNS 項目。這樣可以讓您稍後不必重新設定接聽程式。 Note: You can create the availability groups with temporary database names so SharePoint can use the listeners when the farm is configured. This is so the database connection strings point to the appropriate DNS entries created by the listeners. This saves you having to reconfigure the listeners later.
如需詳細資訊,請參閱<設定 SharePoint Server 的 SQL Server AlwaysOn 可用性群組>。For more information, see Configure SQL Server AlwaysOn Availability Groups for SharePoint Server.
如需詳細資訊,請參閱<針對 AlwaysOn 可用性群組建立資料庫鏡像端點 (SQL Server PowerShell)>。如需 SQL Server 2016 資訊,請參閱<資料庫鏡像 - AlwaysOn 可用性群組 - PowerShell>。 For information, see Create a Database Mirroring Endpoint for AlwaysOn Availability Groups (SQL Server PowerShell). For SQL Server 2016 information, see Database Mirroring - Always On Availability Groups- PowerShell.
如需詳細資訊,請參閱<可用性群組接聽程式、用戶端連接及應用程式容錯移轉 (SQL Server)>。如需 SQL Server 2016 資訊,請參閱<接聽程式、用戶端連接和應用程式容錯移轉>。 For information, see Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server). For SQL Server 2016 information, see Listeners, Client Connectivity, Application Failover.
Note: 如果您使用 SQL Server Management Studio 建立可用性群組接聽程式,您必須為每個接聽程式的災害復原子網路新增 IP 位址。如果您是使用 SQL Server New-SqlAvailabilityGroupListenerPowerShell Cmdlet 佈建可用性群組接聽程式,這不是必要項目。復原伺服器陣列會透過 DNS 主機 (A) 項目 (而不是可用性群組接聽程式) 參考 SQL 執行個體。如需詳細資訊,請參閱<New-SqlAvailabilityGroupListener>。 Note: If you create the Availability Group Listeners using SQL Server Management Studio, you have to add an IP address for the disaster recovery subnet for each listener. This is not required if you provision Availability Group Listeners using the SQL Server New-SqlAvailabilityGroupListener PowerShell cmdlet. The recovery farm will reference the SQL instances through DNS host (A) entries and not the Availability Group listeners. For more information, see New-SqlAvailabilityGroupListener.

災害復原的資料庫群組Database grouping for disaster recovery

我們建議您群組 SharePoint 資料庫,並且根據您的災害復原需求,將它們指派給不同的可用性群組。We recommend that you group SharePoint databases and assign them to different availability groups based on your disaster recovery requirements.

您需要執行這項操作,因為每個可用性群組為了高可用性,有內部部署同步認可複本,在災害復原環境中有非同步認可複本。You need to do this because each availability group has a synchronous commit replica on-premises for high availability and an asynchronous commit replica in the disaster recovery environment.

如同「SharePoint 資料庫支援的高可用性和災害復原選項」章節中所述,支援同步認可的資料庫不一定支援非同步複本。下表是資料庫如何針對特定 Always On 可用性群組分組的範例。As noted in the Supported high availability and disaster recovery options for SharePoint databases section, databases that support synchronous commit don't necessarily support async replicas. The following table is an example of how databases can be grouped for specific Always On Availability Groups.

可用性群組名稱Availability Group name SharePoint 資料庫SharePoint databases
AG_SPConfig (1)AG_SPConfig (1)
SharePoint 組態、SharePoint 管理內容、狀態服務和 UPS 同步 (僅限 AG 同步)SharePoint Config, SharePoint Admin Content, State Service, and UPS Sync (AG Synchronous only)
AG_SPContentAG_SPContent
WSS 內容 XWSS Content X
AG_SPServicesAG_SPServices
應用程式管理、Business Connectivity Services、受管理的中繼資料、PerformancePoint、PowerPivot、Secure Store Service、訂閱設定、機器翻譯服務、UPS Profile 和 UPS Social、Word Automation 以及使用量 (此資料庫僅支援同步認可,因為它保留用於資料採礦的暫時性資料,所以我們不建議在災害復原案例中複製此資料。) (2)App Management, Business Connectivity Services, Managed Metadata, PerformancePoint, PowerPivot, Secure Store Service, Subscription Settings, Machine Translation Services, UPS Profile and UPS Social, Word Automation, and Usage (This database supports only synchronous commit, and because it holds transient data that's used for data mining, we don't recommend replicating this data in a disaster recovery scenario.) (2)
AG_SPSearchAG_SPSearch
搜尋管理、搜尋編目、搜尋連結和搜尋分析報告Search Admin, Search Crawl, Search Link, and Search Analytics Reporting

(1) 這些名稱只是範例。您可以使用您自己的命名慣例。(1) These names are only examples. You can use your own naming convention.

(2) 使用量資料庫可以在叢集中的每個 SQL Server 執行個體上個別建立。除了儲存暫時性資料,它也有極高的交易,這是為何不將它放在可用性群組中的另一個原因。您可以利用 Set-SPUsageApplication Cmdlet 在次要 SQL 執行個體中建立資料庫。然後使用 Set-SPUsageApplication Cmdlet 與 -FailoverDatabaseServer 選項,在高可用性的環境中指定次要 SQL 執行個體。(2) The Usage database can be created independently on each SQL Server instance in the cluster. In addition to storing transient data, it also has very high transactions, which is another reason not to place it in an availability group. You can utilize the Set-SPUsageApplication cmdlet to create the database in the secondary SQL instance. Then use the Set-SPUsageApplication cmdlet with the -FailoverDatabaseServer option to specify the secondary SQL instance in the highly available environment.

下一個表格描述在建置階段 1 結尾的測試組態。The next table describes our test configuration at the end of Build phase 1.

伺服器名稱Server name 描述Description
DC2DC2
網域控制站Domain controller
SP-WFE1,SP-WFE2SP-WFE1, SP-WFE2
Web 內容伺服器Web content servers
SP-APP1 到 SP-APP6 (含)SP-APP1 to SP-APP6 inclusive
應用程式伺服器 (例如,管理中心、服務和搜尋)Application servers (for example, Central Administration, services, and search)
SP-SQL-HA1,SP-SQL-HA2SP-SQL-HA1, SP-SQL-HA2
這些伺服器設定為我們 WSFC 叢集 (SPDRCluster) 中的兩個節點,各有一個投票。裝載伺服器陣列資料庫,以 Always On 可用性群組設定。SP-SQL-HA1 具有主要複本角色,SP-SQL-HA2 具有次要複本角色。系統會設定以下這些可用性群組和接聽程式: Availability groups = PROD-AG1、PROD-AG2、PROD-AG3、PROD-AG4; Listeners = SQL-PROD-AG1、SQL-PROD-AG2、SQL-PROD-AG3、SQL-PROD-AG4 These servers are configured as two nodes in our WSFC cluster (SPDRCluster), each with one vote. Host the farm databases, configured with Always On Availability Groups. SP-SQL-HA1 has the primary replica role and SP-SQL-HA2 has the secondary replica role. These availability groups and listeners are configured: Availability groups = PROD-AG1, PROD-AG2, PROD-AG3, PROD-AG4; Listeners = SQL-PROD-AG1, SQL-PROD-AG2, SQL-PROD-AG3, SQL-PROD-AG4
FS1FS1
這部伺服器會為 WSFC 叢集提供檔案共用叢集仲裁 (Hybrid5SPDRClusterQuorum)。它也可用來作為測試伺服器陣列的共用發佈軟體點。This server provides the file share cluster quorum (Hybrid5SPDRClusterQuorum) for the WSFC cluster. It is also used as a shared distribution software point for the test farm.
OP-FILESERVER (選擇性)OP-FILESERVER (optional)
這部伺服器會為內部部署環境提供分散式檔案系統複寫 (DFSR) 服務端點。另一個端點是在我們的 Azure 環境中。DFSR 為兩個目的提供服務。首先,我們使用它來儲存 SQL Server 備份 (增量與完整),該備份會寫入到 Azure 中的伺服器 (AZSP-FS1)。我們已進行過這項操作以模擬離站儲存空間,在災害復原案例中,我們可以使用這個備份來還原 SharePoint 搜尋。DFSR 組態也可讓我們相對輕易地在兩個伺服器陣列之間移動檔案。This server provides a Distributed File System Replication (DFSR) service endpoint for the on-premises environment. The other endpoint is in our Azure environment. DFSR serves two purposes. First, we use it to store SQL Server backups (incremental and full) which are written to a server (AZSP-FS1) in Azure. We did this to simulate off-site storage and in a disaster scenario, we can use this backups to restore SharePoint search. The DFSR configuration also lets us move files between the two farms relatively easily.

建置階段 2Build phase 2

此影像顯示建置階段 2 中部署 SharePoint 伺服器,並建立內部部署伺服器陣列的步驟

接下來的表格提供建置階段 2 中步驟的詳細資訊。The next table provides more information about the steps in Build phase 2.

步驟Step 附註和指引Notes and guidance
1.建立建置指令碼1. Create build scripts
我們建議您開發一組建置指令碼來安裝 SharePoint Server 2016。這些指令碼也可用來建置復原伺服器陣列 (和未來的 SharePoint 伺服器陣列)。因為復原伺服器陣列將會具有與內部部署伺服器陣列相同的服務應用程式,最佳作法是使用相同的服務應用程式和資料庫名稱。指令碼處理會減少組態錯誤,並且確保伺服器陣列組態的一致性。 We recommend that you develop a set of build scripts to install SharePoint Server 2016. These scripts can also be used to build out the recovery farm (and future SharePoint farms). Because the recovery farm will have service applications that are identical to those in the on-premises farm, it's a best practice to use identical service application and database names. Scripting reduces configuration errors and ensures consistency in farm configuration.
Note: 服務應用程式會根據資料庫名稱來參考其資料庫,與內容資料庫不同,內容資料庫也有儲存在 SharePoint 組態資料庫的資料庫識別碼。Note: Service applications reference their databases by the database name, unlike the Content databases, which also have a database ID that's stored in the SharePoint configuration database.
有幾個已編寫指令碼 SharePoint 安裝的範例,您可以在您的環境中利用。例如, AutoSPInstaller 是可以在 Codeplex 使用的端對端開放原始碼程式。 There are several examples of scripted SharePoint installations that you might be able to leverage in your environment. For example, AutoSPInstaller is an end-to-end open source program available at Codeplex.
確保伺服器陣列組態資料庫、內容資料庫和服務應用程式資料庫指向您使用之 SQL Server 執行個體的 DNS 別名。SharePoint Server 2016 資料庫會以對應至 SQL Server 執行個體的連接字串來建立。稍後會使用 SharePoint ServerPowerShell Cmdlet 將它們移至可用性群組。 Ensure that the farm configuration database, the content databases, and service application databases point to the DNS alias of the SQL Server instance that you use. The SharePoint Server 2016 databases will be created with a connection string mapped to the SQL Server instance. Later they will be moved to availability groups using SharePoint Server PowerShell cmdlets.
您建立伺服器陣列組態資料庫之後,我們建議指令碼處理下列一般工作:After you create the farm configuration databases, we recommend scripting the following common tasks:
使用 Join-SharePointFarm Cmdlet,將 SharePoint Server 加入伺服器陣列。Join a SharePoint Server to the farm by using the Join-SharePointFarm cmdlet
使用 New-SPManagedAccount Cmdlet,登錄受管理帳戶。Register Managed Accounts by using the New-SPManagedAccount cmdlet
建立 Web 應用程式Create Web Applications
建立網站集合Create Site Collections
建立服務應用程式Create Service Applications
設定 SharePoint 應用程式網域和前置詞Set the SharePoint App domain and Prefix
2.安裝必要條件和二進位檔2. Install prerequisites and binaries
如需詳細資訊,請參閱從網路共用安裝 SharePoint Server 的必要條件For more information, see Install prerequisites for SharePoint Server from a network share.
3.設定伺服器陣列 SMTP 設定、Web 應用程式以及網站集合3. Configure Farm SMTP Settings, Web Apps, and Site Collections
使用 New-SPWebApplication Cmdlet 來建立 Web 應用程式,並且使用 New-SPSite Cmdlet 來建立網站集合。Use the New-SPWebApplication cmdlet to create Web Applications and use the New-SPSite cmdlet to create Site Collections.
4.設定服務應用程式4. Configure Service Applications
使用 Index of Windows PowerShell cmdlets for SharePoint Server 2016 中的服務應用程式 Cmdlet 來設定服務應用程式。Use the Service Application cmdlets in Index of Windows PowerShell cmdlets for SharePoint Server 2016 to configure service applications.
5.將內部部署生產伺服器陣列資料庫新增至可用性群組並且同步處理複本5. Add the on-premises production farm databases to availability groups and synchronize the replicas
當您完成設定伺服器陣列時,將伺服器陣列資料庫新增至適當的可用性群組。使用這些 PowerShell Cmdlet 來新增資料庫,並且驗證它們已新增至您指定的可用性群組, Add-DatabasetoAvailabilityGroupGet-AvailabilityGroupStatusWhen you finish configuring the farm, add the farm databases to the appropriate availability groups. Use these PowerShell cmdlets to add the databases and verify that they've been added to the availability group you specify, Add-DatabasetoAvailabilityGroup and Get-AvailabilityGroupStatus
Important: 請確定您在將資料庫新增至可用性群組之前,在所有資料庫上啟用完整復原模式。Important: Make sure that you enable the full recovery model on all databases that are to be added to an availability group before you add them.
將伺服器陣列組態資料庫新增至可用性群組之後,您必須重新啟動伺服器陣列中的所有伺服器,以確保伺服器陣列穩定性。After you add the farm configuration database to an availability group you must restart all the servers in the farm to ensure farm stability.
同步處理可用性群組複本。如需詳細資訊,請參閱<選取初始資料同步處理頁面 (AlwaysOn 可用性群組精靈)>。Synchronize the availability group replicas. For more information, see Select Initial Data Synchronization Page (AlwaysOn Availability Group Wizards).

建置階段 3Build phase 3

此圖顯示建置階段 3 中在復原環境設定 WSFC 和 SQL Server 的步驟

接下來的表格提供建置階段 3 中步驟的詳細資訊。The next table provides more information about the steps in Build phase 3.

步驟Step 附註和指引Notes and guidance
1.將兩個節點新增至 Azure 災害復原資料中心,如此會延展內部部署 WSFC 叢集1. Add two nodes to the Azure disaster recovery datacenter which will stretch the on-premises WSFC cluster
在將會成為新叢集節點的伺服器上進行這些設定、安裝 Windows 容錯移轉叢集功能、測試叢集,然後從新節點移除仲裁投票。Configure these settings on the server that will be the new cluster node; Install the Windows Failover clustering feature, test the cluster, and then remove the quorum vote from the new node.
以系統管理員身分開啟 Windows PowerShell 命令列,並且執行下列 Cmdlet 以安裝 Windows 容錯移轉叢集功能和管理工具: Install-WindowsFeature -Name Failover-Clustering -IncludeManagementToolsOpen the Windows PowerShell command line as an Administrator and run the following cmdlet to install the Windows Failover clustering feature and management tools: Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools
使用下列 Cmdlet 測試叢集: Test-ClusterTest the cluster with the following cmdlet: Test-Cluster
使用下列命令,從伺服器移除仲裁投票: (Get-ClusterNode {CLUSTERNODENAME}).NodeWeight=0Remove the Quorum vote from the server with the following commands: (Get-ClusterNode {CLUSTERNODENAME}).NodeWeight=0
如需詳細資訊,請參閱<設定和管理 Windows Server 2012 容錯移轉叢集中的仲裁>。如需 Windows Server 2016 資訊,請參閱<部署雲端見證容錯移轉叢集>。 For more information, see Configure and Manage the Quorum in a Windows Server 2012 Failover Cluster. For Windows Server 2016 information, see Deploy a Cloud Witness for a Failover Cluster.
Note: 如果您使用與我們的測試環境相同的架構,您必須在復原環境中的兩個 SQL Server 執行個體上,都執行這些設定步驟。Note: If you use the same architecture as our test environment, you'll have to perform these configuration steps on both the SQL Server instances in the recovery environment.
2.安裝 SQL Server 執行個體2. Install the SQL Server instances
在兩個節點上都安裝 SQL Server。請確定每個 SQL 執行個體的資料路徑完全相同,且組態完全相同,例如,連接埠組態、資料庫定序等等。如需詳細資訊,請參閱<從安裝精靈安裝 SQL Server 2014 (安裝程式)>。另請參閱<從安裝精靈安裝 SQL Server 2016 (安裝程式)>。 Install SQL Server on both nodes. Ensure that the data paths are exactly the same for each SQL instance and that the configurations are identical, for example, port configurations, database collation, and so on. For more information, see Install SQL Server 2012 from the Installation Wizard (Setup). Also, see Install SQL Server from the Installation Wizard (Setup).
3. 啟用 SQL Server Always On 可用性群組3. Enable SQL Server Always On Availability Groups
使用 SQL Server 組態管理員以啟用 SQL Server Always On 可用性群組。如需詳細資訊,請參閱<啟用和停用 AlwaysOn 可用性群組 (SQL Server)>如需 SQL Server2016 指引,請參閱<啟用和停用 AlwaysOn 可用性群組 (SQL Server)>。 Use SQL Server Configuration Manager to enable SQL Server Always On Availability Groups. For more information, see Enable and Disable AlwaysOn Availability Groups (SQL Server). For SQL Server 2016 guidance, see Enable and Disable Always On Availability Groups (SQL Server).
請參閱建置階段 1 中的表格,以取得將 SharePoint Server 2016 資料庫邏輯群組至可用性群組的範例。Refer to the table in Build phase 1 for examples of the logical grouping of SharePoint Server 2016 databases to availability groups.
4.設定伺服器陣列帳戶安全性4. Configure farm account security
在每個 SQL Server 執行個體為 SharePoint 安裝使用者系統管理員帳戶設定適當的權限。此帳戶必須是 db_owner 角色的成員,並且在安裝及設定期間指派給 securityadmindbcreator SQL Server 安全性角色。 Configure the appropriate permissions in each SQL Server instance for the SharePoint setup user administrator account. This account must be a member of the db_owner role and assigned to the securityadmin and dbcreator SQL Server security roles during setup and configuration.
如需詳細資訊,請參閱設定 SharePoint Server 的 SQL Server 安全性SharePoint Server 2016 中的帳戶權限及安全性設定SharePoint 2013 中的帳戶權限及安全性設定For more information, see Configure SQL Server security for SharePoint Server, Account permissions and security settings in SharePoint Server 2016, and Account permissions and security settings in SharePoint 2013

建置階段 4Build phase 4

此影像顯示建置階段 4 中在 Azure 部署 SharePoint,並建立復原伺服器陣列的步驟

接下來的表格提供建置階段 4 中步驟的詳細資訊。The next table provides more information about the steps in Build phase 4.

步驟Step 附註和指引Notes and guidance
1.建立建置指令碼1. Create build scripts
我們建議您開發一組建置指令碼來安裝 SharePoint Server。這些指令碼也可用來建置復原伺服器陣列 (和未來的 SharePoint 伺服器陣列)。因為復原伺服器陣列將會具有與內部部署伺服器陣列相同的服務應用程式,最佳作法是使用相同的服務應用程式和資料庫名稱。指令碼處理會減少組態錯誤,並且確保伺服器陣列組態的一致性。 We recommend that you develop a set of build scripts to install SharePoint Server. These scripts can also be used to build out the recovery farm (and future SharePoint farms). Because the recovery farm will have service applications that are identical to those in the on-premises farm, it's a best practice to use identical service application and database names. Scripting reduces configuration errors and ensures consistency in farm configuration.
Note: 服務應用程式會根據資料庫名稱來參考其資料庫,與內容資料庫不同,內容資料庫也有儲存在 SharePoint 組態資料庫的資料庫識別碼。Note: Service applications reference their databases by the database name, unlike the Content databases which also have a database ID that's stored in the SharePoint configuration database.
有幾個使用 PowerShell 的已編寫指令碼 SharePoint 安裝範例。例如,AutoSPInstaller 是可以在 Codeplex 使用的端對端開放原始碼程式。There are several examples of scripted SharePoint installations that use PowerShell. For example, AutoSPInstaller is an end-to-end open source program available at Codeplex.
確保伺服器陣列組態資料庫、內容資料庫和服務應用程式資料庫指向您使用之 SQL Server 執行個體的 DNS 別名。SharePoint Server 資料庫會以對應至 SQL Server 執行個體的連接字串來建立。稍後會使用 SharePoint PowerShell Cmdlet 將它們移至可用性群組。 Ensure that the farm configuration database, the content databases, and service application databases point to the DNS alias of the SQL Server instance that you use. The SharePoint Server databases will be created with a connection string mapped to the SQL Server instance. Later they will be moved to availability groups using SharePoint PowerShell cmdlets.
您建立伺服器陣列組態資料庫之後,我們建議指令碼處理下列一般工作:After you create the farm configuration databases, we recommend scripting the following common tasks:
使用 Join-SharePointFarm Cmdlet,將 SharePoint Server 加入伺服器陣列。使用 New-SPManagedAccount Cmdlet,登錄受管理帳戶。建立 Web 應用程式、網站集合和服務應用程式。最後,設定 SharePoint 應用程式網域和前置詞。 Join a SharePoint Server to the farm by using the Join-SharePointFarm cmdlet. Register Managed Accounts by using the New-SPManagedAccount cmdlet. Create Web applications, site collections, and service applications. Finally, set the SharePoint App domain and prefix.
2. 安裝必要條件和二進位檔2. Install the prerequisites and binaries
如需詳細資訊,請參閱從網路共用安裝 SharePoint Server 的必要條件For more information, see Install prerequisites for SharePoint Server from a network share.
3.設定伺服器陣列 SMTP 設定、Web 應用程式以及網站集合3. Configure farm SMTP settings, Web Applications, and Site Collections
使用 New-SPWebApplication Cmdlet 來建立 Web 應用程式,並且使用 New-SPSite Cmdlet 來建立網站集合。Use the New-SPWebApplication cmdlet to create Web Applications and use the New-SPSite cmdlet to create Site Collections.
4.設定服務應用程式4. Configure Service Applications
使用 Index of Windows PowerShell cmdlets for SharePoint Server 2016 中的服務應用程式 Cmdlet 來設定服務應用程式。Use the Service Application cmdlets in Index of Windows PowerShell cmdlets for SharePoint Server 2016 to configure service applications.
Note: 服務應用程式是在災害復原伺服器陣列中建立,具有與主要伺服器陣列完全相同的名稱。請確定資料庫名稱也與主要伺服器陣列完全相同,因為資料庫會被災害復原伺服器陣列中的服務應用程式參考,服務應用程式資料庫在災害復原伺服器陣列中最終會建立為複本。處理程序的其中一部分是當非同步複本新增至 SQL 可用性群組時,災害復原伺服器陣列中的資料庫會從主要複本還原。 Note: Service Applications are created in the disaster recovery farm, with the exact same name as the primary farm. Ensure the database names are also named exactly the same as the primary farm, as the database will be referenced by the Service Applications in the disaster recovery farm, where the service application databases will eventually be created as replicas. As part of the process, the databases in the disaster recovery farm will be restored from the primary replicas, when the asynchronous replicas are added to the SQL Availability Group.
災害復原伺服器陣列中的內容資料庫可以從 SharePoint 組態移除,因為主要伺服器陣列內容資料庫在災害復原 SQL Server 執行個體中會有唯讀複本可用。The content databases in the disaster recovery farm can be removed from the SharePoint configuration as the primary farm content databases will have a read-only replica available in the disaster recovery SQL Server instance.
使用 SharePoint 2016 管理命令介面以執行下列 PowerShell Cmdlet,從災害復原伺服器陣列卸載任何內容資料庫: Remove-SPContentDatabaseUse the SharePoint 2016 Management Shell to run the following PowerShell cmdlet to dismount any content databases from the disaster recovery farm Remove-SPContentDatabase.
如果災害復原伺服器陣列中的 SQL Server 執行個體上有任何內容資料庫存在,請全部刪除。您可以使用下列任何方法:DROP DATABASE (Transact-SQL)Database.Drop 方法 ()刪除資料庫If any additional content databases exist on the SQL Server instances in the disaster recovery farm, delete all of them. You can use any of these methods, DROP DATABASE (Transact-SQL), Database.Drop Method (), or Delete a Database.
5. 關閉伺服器陣列5. Shut down the farm
完成設定 SharePoint 之後,請關閉伺服器陣列。現在,您可以在內部部署伺服器陣列上建立資料庫的非同步複本。Shut down the farm after you finish configuring SharePoint. Now you can create asynchronous replicas for the databases on the on-premises farm.

建置階段 5Build phase 5

此圖顯示建置階段 5 中完成設定 Azure 端點,並將資料庫複寫到復原伺服器陣列的步驟

接下來的表格提供建置階段 5 中步驟的詳細資訊。The next table provides more information about the steps in Build phase 5.

步驟Step 附註和指引Notes and guidance
1.確認 SQL 執行個體可以存取資料庫及備份共用。1. Verify that the SQL instance can access the database and backup shares.
可用性群組中的每個節點必須能夠存取一般備份位置。對於在將複本新增至可用性群組處理期間的初始資料庫植入,這是必要的。Each node in an availability group must have access to a common backup location. This is required for the initial database seeding during the process of adding replicas to the availability group.
SQL Server 帳戶必須能夠存取一般備份位置。The SQL Server account must have access to the common backup location.
2.建立 SQL Server 端點並且授與連線權限給端點。2. Create a SQL Server endpoint and grant connect permissions to the endpoint.
您必須在災害復原 SQL Server 執行個體上建立登入,以便建立次要複本,並且將資料庫加入可用性群組。如需詳細資訊,請參閱<設定資料庫鏡像或 AlwaysOn 可用性群組的登入帳戶 (SQL Server)>和<設定登入帳戶 - 資料庫鏡像 AlwaysOn 可用性>。 You must create a logon on the disaster recovery SQL Server instance in order to create a secondary replica and join the databases to the Availability Groups. For more information, see Set Up Login Accounts for Database Mirroring or AlwaysOn Availability Groups (SQL Server) and Set Up Login Accounts - Database Mirroring Always On Availability.
主要複本上需要 SQL Server 端點,讓 SQL 執行個體可以將記錄緩衝區傳送至次要複本。使用<針對 AlwaysOn 可用性群組建立資料庫鏡像端點 (SQL Server PowerShell)>和<資料庫鏡像 - AlwaysOn 可用性群組 - PowerShell>中的程序以建立端點。 A SQL Server endpoint is required on the primary replica so the SQL instance can send log buffers to the secondary replicas. Use the process in Create a Database Mirroring Endpoint for AlwaysOn Availability Groups (SQL Server PowerShell) and Database Mirroring - Always On Availability Groups- PowerShell to create the endpoint.
您必須將主要 SQL Server 執行個體上服務帳戶的存取權給予端點,才能將記錄緩衝區傳輸至災害復原執行個體。需要連線權限。 You must give the service account on the primary SQL Server instance access to the endpoint in order to transfer log buffers to the disaster recovery instances. Connect permission is required.
如需詳細資訊,請參閱<授與端點權限 (Transact-SQL)>。For more information, see GRANT Endpoint Permissions (Transact-SQL).
3.在復原伺服器陣列執行個體中建立使用者內容和服務應用程式資料庫的次要複本。3. Create secondary replicas of the user content and service application databases in the recovery farm instance.
每個可用性群組都需要災害復原伺服器陣列中的次要複本。您必須連線到裝載主要複本的 SQL 執行個體,才能建立次要複本。 Each Availability Group requires a secondary replica in the disaster recovery farm. You must be connected to the SQL instance that is hosting the primary replica before you can create the secondary replica.
如需詳細資訊,請參閱<將次要複本新增至可用性群組 (SQL Server)>。For more information, see Add a Secondary Replica to an Availability Group (SQL Server).
4.請確定復原伺服器陣列的複本設定為唯讀存取。4. Ensure that the replicas in the recovery farm are configured for Read-Only access.
DR SL 伺服器執行個體的可用性複本設定為可讀取的次要複本。災害復原伺服器陣列會以唯讀模式存取服務應用程式和內容資料庫。這是因為復原伺服器陣列已參考服務應用程式資料庫名稱。這樣可以在我們容錯移轉至 DR 環境時,減少復原時間目標 (RTO)。 The availability replicas in the DR SL Server instances are configured as readable secondary replicas. The disaster recovery farm will access the service application and content databases in read-only mode. This is because the recovery farm is already referencing the service application database names. This reduces the Recovery Time Objective (RTO) when we failover to the DR environment.
附註: 如果未正確設定,您可能會在復原環境中遇到錯誤。Note: If this is not configured correctly, you may experience errors in the recovery environment.
如需詳細資訊,請參閱<設定可用性群組的唯讀路由 (SQL Server)>和<設定可用性複本上的唯讀存取 (SQL Server)>。For more information, see Configure Read-Only Routing for an Availability Group (SQL Server) and Configure Read-Only Access on an Availability Replica (SQL Server).
5.將登入從主要 SQL Server 執行個體複製到次要 SQL Server 執行個體。5. Copy logons from the primary SQL Server instance to the secondary SQL Server instances.
您必須將 SQL 登入和密碼從主要執行個體複製到次要執行個體。SQL Server 只會複製可用性群組資料庫的內容。登入和密碼不會從一個執行個體複製到另一個執行個體。 You have to copy SQL logons and passwords from the primary instance to the secondary instances. SQL Server copies only the content of an availability group database. Logons and passwords are not copied from one instance to another.
如需詳細資訊,請參閱<如何在 SQL Server 執行個體之間傳送登入和密碼>與<針對孤立使用者進行疑難排解 (SQL Server)>。For more information, see How to transfer logins and passwords between instances of SQL Server and Troubleshoot Orphaned Users (SQL Server).

建置階段 6Build phase 6

此圖顯示建置階段 6 中為復原伺服器陣列完成設定 SharePoint 的步驟

接下來的表格提供建置階段 6 中步驟的詳細資訊。The next table provides more information about the steps in Build phase 6.

步驟Step 附註和指引Notes and guidance
1.開啟復原伺服器陣列1. Power up the recovery farm
現在服務應用程式和內容資料庫可以在復原伺服器陣列 SQL 執行個體中的唯讀模式取用,您可以開啟 SharePoint 伺服器陣列。Now that the service application and content databases are available in read-only mode in the recovery farm SQL instances, you can power up the SharePoint farm.
2. 將內容資料庫裝載到 Web 應用程式。2. Mount the content databases to the web application(s)
對於災害復原 SQL 執行個體 (保留主要伺服器陣列中最多的目前內容) 中具有唯讀複本的每個內容資料庫,資料庫必須裝載於災害復原伺服器陣列中適當的 Web 應用程式中。您可以使用 Mount-SPContentDatabase Cmdlet 卸載內容資料庫。 For every content database that has a read-only replica in the disaster recovery SQL instance, which holds the most current content in the primary farm, the database needs to be mounted in the appropriate web applications in the disaster recovery farm. You can use the Mount-SPContentDatabase cmdlet to mount the content databases.
3. 重新整理組態資料庫中的站台3. Refresh sites in configuration database
我們建議您重新整理 SharePoint 組態資料庫中的站台。使用此表格後面附註 (1) 中顯示的 PowerShell 範例,以重新整理每個內容資料庫的站台。 We recommend that you refresh the sites in the SharePoint configuration database. Use the PowerShell example shown in the (1) note after this table, to refresh the sites for each content database.
4. 檢查伺服器陣列服務4. Check the farm services
確認所有伺服器陣列服務如預期般執行。Verify that all the farm services are running as expected.
5.執行伺服器陣列狀況檢查5. Perform a farm health check
在伺服器陣列上執行狀況檢查,以確定伺服器陣列穩定且運作正常。Perform health checks on the farm to make sure that the farm is stable and working correctly.

(1): 針對建置階段 6 表格中的步驟 3 使用下列 PowerShell 語法。(1): Use the following PowerShell syntax for step 3 in the Build phase 6 table.

# Refresh sites in the configuration database
Get-SPContentDatabase -WebApplication http://webapplicationsitename | | ForEach {
Write-host "Refreshing sites in configuration database for database: " $_.Name
$_.RefreshSitesInConfigurationDatabase()
}

測試伺服器陣列容錯移轉和復原Test farm failover and recovery

本章節中的程序會說明如何模擬伺服陣列容錯移轉,然後模擬復原。在復原之後,使用容錯回復為內部部署伺服器陣列的程序。The procedures in this section explain how to simulate a farm failover and then a recovery. After the recovery use the procedures to failback to the on-premises farm.

建置程序的一部分是建立 DR 伺服器陣列上的服務應用程式。因為服務應用程式將會從完整站台失敗還原,所以它們會處於災害復原站台的寫入模式,其原因是在災害復原容錯移轉完成之後,災害復原 SQL 執行個體中 SQL 可用性群組的復原會變成主要複本。資料移動到主要資料中心的 SQL Server 執行個體不會再繼續,直到手動重新啟動之前都會處於暫停狀態。當 SQL 執行個體裝載主要可用性群組複本時,所有其他複本會被視為可用性群組中的次要複本。Service applications on the DR farm were created as part of the build process. Since the service applications will be recovered from a full site failure, they will be in write mode in the disaster recovery site as the recovery of the SQL Availability Groups in the disaster recovery SQL instances will become the primary replica after the disaster recovery failover is complete. Data movement to the SQL Server instances in the primary data center will no longer continue and will be placed in a paused state until they are manually restarted. When a SQL instance hosts a primary Availability Group Replica, all other replicas are considered secondary replicas in the Availability Group.

當您啟動容錯移轉時,使用下列步驟在容錯移轉環境中復原 SharePoint 伺服器陣列。Use the following steps to recover the SharePoint farm in the failover environment when you start a failover.

容錯移轉步驟 1Failover step 1

災害復原決策通常會根據商務持續性管理 (BCM) 小組和服務擁有者而啟動。DR 決策通常會在無法再存取主要站台,且執行下列程序將主要伺服器陣列容錯移轉至災害復原伺服器陣列時,被納入考量。A disaster recovery decision is typically started based on management decisions by Business Continuity Management (BCM) teams and service owners. The DR decision is usually considered when the primary site is no longer accessible and the following procedures will perform a failover of the primary farm to the disaster recovery farm.

容錯移轉步驟 2Failover step 2

Start a cluster and availability group failoverStart a cluster and availability group failover

使用下列清單中顯示的 PowerShell Cmdlet,執行叢集和可用性群組的容錯移轉。Perform a failover of the cluster and the availability groups by using the PowerShell cmdlets shown in the following list.

  1. 使用 Stop-Service Clussvc 來停止叢集服務。Stop the Cluster Service by using the Stop-Service Clussvc.

  2. 使用下列命令來啟動叢集節點並修正仲裁:Start the cluster node and fix the Quorum by using the following command:

    Start-ClusterNode -Name <ACTIVE SQL NODE> -FixQuorum
    
  3. 使用下列命令,將叢集群組移至災害復原資料中心的使用中 SQL 節點。Move the cluster group to an active SQL node in the disaster recovery data center by using the following command.

    Move-ClusterGroup -Cluster  <CLIUSTER GROUP>  -node <ACTIVE SQL NODE>
    
  4. 使用下列命令確認叢集服務已啟動。Confirm the Cluster Service is started by using the following command.

    Get-ClusterNode -Name "<NodeName>"
    
  5. 調整叢集的投票權限。必須為災害復原站台中的所有 SQL Server 節點提供仲裁投票權限。為災害復原資料中心的每個叢集節點重複下列命令。Adjust the voting rights for the cluster. All SQL Server nodes in the disaster recovery site must be provided Quorum voting rights. Repeat the following command for each cluster node in the disaster recovery datacenter.

    (Get-ClusterNode -Name "NodeName").NodeWeight=1
    Get-ClusterNode | fl Name, NodeWeight
    
  6. 遠端節點被授與仲裁投票之後,使用下列命令以移除內部部署伺服器陣列中兩個節點的投票。After the remote node is granted a vote for the Quorum, use the following command to remove the votes of the two nodes in the on-premises farm.

    (Get-ClusterNode -name "Node1").NodeWeight=0
    (Get-ClusterNode -name "Node2").NodeWeight=0
    
  7. 使用下列命令以檢查節點權數設定。Use the following command to check the node weight settings.

    Get-ClusterNode | fl Name,NodeWeight
    
  8. 當成功套用節點權數時,可以使用 SQL Server Switch-SqlAvailabilityGroup Cmdlet,將可用性群組移至災害復原伺服器陣列中適當的 SQL Server 執行個體。執行此 Cmdlet 時,您必須使用 -AllowDataLoss 參數。例如:When the node weights are applied successfully, the availability groups can be moved to the appropriate SQL Server instances in the disaster recovery farm by using the SQL Server Switch-SqlAvailabilityGroup cmdlet. You must use the -AllowDataLoss parameter when you run this cmdlet. For example:

    Switch-SqlAvailabilityGroup -Path SQLSERVER:\Sql\<SQLNODE>\<MSQLINSTANCE>\AvailabilityGroups\<AGName> -AllowDataLoss
    
  9. 為每個可用性群組執行這項作業。Perform this operation for each Availability Group.

如需詳細資訊,請參閱<執行可用性群組的已規劃手動容錯移轉 (SQL Server)>。For more information, see Perform a Planned Manual Failover of an Availability Group (SQL Server).

容錯移轉步驟 3Failover step 3

SharePoint Content DatabasesSharePoint Content Databases

裝載並非原始伺服器陣列組態一部分的任何其他 SharePoint 內容資料庫。因為初始部署且新增至可用性群組,所以可能會建立額外的內容資料庫。Mount any additional SharePoint content databases that were not part of the original farm configuration. Additional content databases were probably created since the initial deployment and added to an availability group.

重要

這是主要伺服器陣列中建立的任何內容資料庫,新增至可用性群組並且裝載於災害復原伺服器陣列之作業程序非常重要的一部分。It is very important as part of an operational process that any content databases created in the primary farm are added to the availability groups and mounted in the disaster recovery farm.

使用 Mount-SPContentDatabase Cmdlet 卸載內容資料庫。Use the Mount-SPContentDatabase cmdlet to mount the content databases.

我們建議您重新整理 SharePoint 組態資料庫中的站台。對於每個內容資料庫,使用下列程式碼以重新整理組態資料庫中的站台。這樣可以確保網站地圖是最新狀態。We recommend that you refresh the sites in the SharePoint Configuration database. For each Content database, use the following code to refresh the sites in the Configuration database. This ensures that the site map is up to date.

# Refresh sites in the configuration database
Get-SPContentDatabase -WebApplication http://webapplicationsitename | | ForEach {
Write-host "Refreshing sites in configuration database for database: " $_.Name
$_.RefreshSitesInConfigurationDatabase()
}

容錯移轉步驟 4Failover step 4

Service ApplicationsService Applications

以 SharePoint 伺服器陣列管理員群組的成員身分登入,並且完成下列工作:Log on as a member of the Farm Administrators SharePoint group and complete the following tasks:

  1. 請確認服務應用程式可以存取。Verify the service applications are accessible.

  2. 在災害復原伺服器陣列中的一部伺服器上啟動使用者設定檔同步處理服務。Start the User Profile Synchronization Service on one server in the disaster recovery farm.

  3. 執行使用者設定檔的完整匯入。Perform a full import of the user profiles.

注意

Secure Store Service 可能會要求 SharePoint 伺服陣列管理員重新整理金鑰,以便解密在 Secure Store 中登錄的應用程式。系統管理員在重新整理金鑰之前,必須擁有 Secure Store 的完整權限。您也可以使用 Update-SPSecureStoreApplicationServerKey Cmdlet 來更新 Secure Store 金鑰。The Secure Store Service might require the SharePoint Farm Administrator to refresh the key in order to decrypt the applications that are registered in the Secure Store. The administrator must have full permissions to the Secure Store before refreshing the key. You can also use the Update-SPSecureStoreApplicationServerKey cmdlet to update the Secure Store key.

注意

必須重新啟用使用者設定檔同步處理計時器工作,且應該排程設定檔匯入。因為在容錯移轉之後,資料庫現在處於寫入模式,所以匯入應該據此進行排程。The User Profile Synchronization timer job must be re-enabled and profile imports should be scheduled. Since the databases are now in write mode after a failover, the imports should be scheduled accordingly.

容錯移轉步驟 5Failover step 5

Configure DNS RedirectionConfigure DNS Redirection

更新 DNS 以提供下列重新導向:Update DNS to provide the following redirections:

  • 到 Web 應用程式和網站集合的復原伺服器陣列。To the recovery farm for web applications and site collections.

  • 到應用程式網域的復原伺服器陣列。To the recovery farm for the application domain.

容錯移轉步驟 6Failover step 6

Validate the recoveryValidate the recovery

在您的環境中執行測試案例,以確保如預期般復原。Run Test Cases in your environment to ensure that the recovery is as expected.

驗證復原之後:After you validate the recovery:

  • 啟用使用者設定檔同步處理服務計時器作業。Enable the User Profile Synchronization Service Timer job.

  • 排程復原伺服器陣列的完整備份。Schedule a full backup of the recovery farm.

容錯移轉步驟 7Failover step 7

Send out notificationsSend out notifications

復原驗證完成後,通知適當的商務利益關係人。Notify the appropriate business stakeholders once the recovery validation is complete.

總結Conclusion

在容錯移轉並驗證復原之後,您就可以開始設定伺服器陣列,以符合目前和未來的操作需求,例如,容量與高可用性。這些需求取決於內部部署資料中心中伺服器陣列的停機和復原持續期間。After you failover and validate the recovery you are in a position to start configuring the farm to meet the current and future operational requirements, for example, capacity and high availability. These requirements are determined by the duration of the downtime and recovery of the farm in the on-premises datacenter.

最後請注意,您必須檢閱及驗證當內部部署伺服器陣列再度運作時,容錯回復至該伺服器陣列的規劃。As a final note, you have to review and validate your plan for falling back to the on-premises farm when it's operational again.

附錄Appendix

Appendix 1: Getting started in Microsoft AzureAppendix 1: Getting started in Microsoft Azure

項目Item 附註Notes
Azure 訂用帳戶和儲存體帳戶Azure subscriptions and storage accounts
您至少需要一個訂用帳戶,才能建立 Azure 復原伺服器陣列。您有訂用帳戶之後,可以建立最多 100 個獨特命名的儲存體帳戶。如果是其他 Azure 服務,有標準和進階儲存體帳戶。如需詳細資訊,請參閱<Microsoft Azure 儲存體簡介>。 At a minimum, you will need one subscription to create the Azure recovery farm. After you have a subscription, you can create up to 100 uniquely named storage accounts. As in the case of other Azure services, there are standard and premium storage accounts. For more information, see Introduction to Microsoft Azure Storage.
雲端服務Cloud services
當您建立 VPN 閘道的伺服器時,系統會為虛擬機器建立雲端服務。此時,您必須決定針對復原伺服器陣列,想要多少雲端服務。您當然不會想要伺服器陣列中每個伺服器都有一個雲端服務,但是您應該使用一或多個?!這兩個選項都有很好的立論。藉由將虛擬機器群組到不同的雲端服務,您可以將數個伺服器當作單一單位來使用。在我們的測試伺服器陣列中,我們會使用四個雲端服務。第一個雲端服務用於 VPN 閘道,接著分別用於下列層級:前端 Web 伺服器、應用程式伺服器和資料庫伺服器。如需詳細資訊,請參閱<我該選擇雲端服務還是其他服務?>。 When you create the server for the VPN gateway, a cloud service gets created for the virtual machine. At this point, you have to determine how many cloud services you want to have for the recovery farm. You obviously don't want a cloud service for every server in the farm; but should you use one or several? There are good arguments for both options. By grouping virtual machines into separate cloud services, you can work with several servers as a single unit. In our test farm, we used four cloud services. The first was for the VPN gateway and then one for each of the following tiers: front end web servers, application servers, and the database servers. For more information, see Should I Choose Cloud Services?.
網路功能Networking
虛擬網路在這個災害復原案例中相當重要。如需詳細資訊,請參閱<虛擬網路文件>。Virtual networks are important in this disaster recovery scenario. For more information, see Virtual Network documentation.
PowerShellpowershell
PowerShell Azure Cmdlet 可以協助您自動化虛擬環境中的工作。如需詳細資訊,請參閱<Windows Azure PowerShell Cmdlet (v2.2.2)>。PowerShell Azure cmdlets can help you automate tasks in your virtual environment. For more information, see Windows Azure PowerShell Cmdlets (v2.2.2).
自動化Automation
Azure 支援使用 Runbook 來自動化大範圍的佈建和管理工作。如需詳細資訊,請參閱<開始使用 Azure 自動化>。Azure supports using runbooks to automate a broad range of provisioning and management tasks. For more information, see Getting started with Azure automation.
虛擬機器,調整機器大小Virtual Machines, Machine sizing
Azure VM 有多個系列,這些系列具有不同的效能和容量特性。您可以根據您的工作負載和伺服器陣列層級,混合及比對機器。 Azure VMs are available in multiple series which have different performance and capacity characteristics. You can mix and match machines based on your workloads and farm tiers.
如需詳細資訊,請參閱<Azure 中 Windows 虛擬機器的大小>。For more information, see Sizes for Windows virtual machines in Azure.
可用性設定組Availability sets
可用性設定組是我們建議的選項,因為它們會確保集合 (至少兩部) 中的虛擬機器裝載於不同機架上,以獲得高可用性。如果您想要利用 Azure SLA,它們也是必要的。除了管理虛擬機器的可用性,可用性設定組還會與負載平衡配合運作,並且支援伺服器群組的調整。 Availability sets are an option we recommend because they ensure that the virtual machines in a set (a minimum of two) are hosted on different racks for high availability. They are also required if you want to take advantage of the Azure SLA. In addition to managing the availability of your virtual machines, availability sets work in conjunction with load balancing and support scaling for a group of servers.
附註: SharePoint Server 2016 不支援自動相應增加或相應減少伺服器陣列伺服器。Note: SharePoint Server 2016 doesn't support automatic scale up or scale down of farm servers.
如需詳細資訊,請參閱<管理 Azure 中 Windows 虛擬機器的可用性>。For more information, see Manage the availability of Windows virtual machines in Azure.

另請參閱See also

其他資源Other Resources

Microsoft Azure 中的 SharePoint Server 2016SharePoint Server 2016 in Microsoft Azure