為 SharePoint Server 打造高可用性架構和策略Create a high availability architecture and strategy for SharePoint Server

摘要: 如何在單一 SharePoint Server 2016 和 SharePoint 2013 伺服器陣列中結合伺服器陣列架構和技術,並打造高度可用的環境。Summary: Learn how to combine farm architecture and technology to create a highly available environment in a single SharePoint Server 2016 and SharePoint 2013 farm.

高可用性策略對 SharePoint Server 實際執行環境而言是一項重要需求。端對端策略包括作業程序、平台管理、架構及技術解決方案。本文著重在高可用性的架構和技術層面。本指引將說明決定高可用性策略的特定 SharePoint 設計元素和技術選項。A high-availability strategy is an important requirement for a production SharePoint Server environment. An end-to-end strategy includes operational processes, platform governance, architecture, and technical solutions. This article focuses on the architectural and technical aspects of high availability. The guidance explains specific SharePoint design elements and the technical options that will determine your strategy for high availability.

注意

高可用性和災害復原是不一樣的。雖然在規劃與解決方案上會互相重疊,但都是營運持續力的一部分。高可用性旨在為主要資料中心和預定的停機時間之間提供彈性。而災害復原的宗旨,則是當主要資料中心的災害導致基礎結構無法運用時,能夠協助組織恢復次要資料中心的電腦運作。如需 SharePoint Server 災害復原的相關資訊,請參閱<選擇 SharePoint Server 的災害復原策略>。High availability and disaster recovery are not the same things. Although there is overlap in planning and solutions, they are subsets of business continuity. The purpose of high availability is to provide resiliency within the primary data center and planned downtime. The purpose of disaster recovery is to enable an organization to resume computer operations in a secondary data center when a disaster at the primary data center makes the infrastructure unusable. For information about disaster recovery for SharePoint Server, see Choose a disaster recovery strategy for SharePoint Server.

高可用性通常是描述系統能夠持續運作的能力,而且在容錯網域的硬體、軟體或應用程式等一或多個類別中發生故障時,可提供資源給使用者。可用性層級會以時間百分比的方式表示,測量系統持續運作支援商務功能的時間。可用性的必要層級會依組織而異。雖然此需求也會因業務單位而異,但服務層級協議則是適用組織整體。從使用者的觀點來看,使用者可以存取伺服器陣列並使用工作所需的功能與服務時,就可使用 SharePoint 伺服器陣列。High availability is generally used to describe the ability of a system to continue operating and provide resources to its users when a failure occurs in one or more of the following categories in a fault domain: hardware, software, or application. The level of availability is expressed as a measure of the percentage of time that a system is continuously operational to support business functions. The required level of availability varies among organizations. Although this requirement may also vary among business units, a service level agreement is for the organization as a whole. From the perspective of users, a Sharepoint farm is available when users can access the farm and use the features and services that they must have to do their work.

高可用性 SharePoint 伺服器陣列具備下列目標與特性:A highly available SharePoint farm has the following goals and characteristics:

  • 伺服器陣列設計可降低潛在的故障點。這是因為不太可能消除所有故障點,因此整體策略必須能夠針對如何回應故障事件加以解決。The farm design reduces potential points of failure. Because it is improbable that you can eliminate all failure points, the overall strategy must address how to respond to a failure event.

  • 容錯移轉事件會順暢進行,幾乎不會影響到使用者活動。Failover events are seamless and have minimal effect on user activities.

  • 伺服器陣列會減少容量來持續運作,而不會完全失效。The farm continues to operate at reduced capacity instead of failing completely.

  • 伺服器陣列相當有彈性。不會經常發生影響服務的事件,萬一發生也會即時採取有效行動。The farm is resilient. Incidents affecting service occur infrequently, and timely and effective action is taken when they do occur.

簡介Introduction

在針對 SharePoint 環境建立實際和經濟的高可用性架構和策略之前,必須先定義及量化可用性目標。這些目標反映出貴組織依據 SharePoint Server 所能達到的程度,以及服務遺失會如何影響組織運作。服務遺失造成的影響取決於遺失性質 (全面或部分) 和持續遺失的時間。Before you can create a realistic and economical high-availability architecture and strategy for your SharePoint environment, you have to define and quantify your availability goals. These goals reflect the extent to which your organization depends on SharePoint Server and how a loss of service might affect the organization's operations. The effect of the loss of service depends on the nature of the loss (full or partial) and the duration of the loss.

一項成功的高可用性策略必須能夠反映出組織的特定需求。此外,該策略必須在各項業務需求、IT 服務等級協定 (SLA)、以及技術解決方案、IT 支援能力及基礎結構成本的可用性之間取得最佳平衡。A successful high-availability strategy must reflect the specific needs of your organization. Additionally, it must provide an optimal balance between business requirements, IT service level agreements (SLAs), and the availability of technical solutions, IT support capabilities, and infrastructure costs.

識別出組織的可用性需求後,即可開始打造高可用性的設計和策略,降低停機時間風險和作業效率低落問題。設計和部署高可用系統的 IT 專家會利用下列指引方針來滿足目標:After identifying availability requirements for your organization, you can begin to create a high-availability design and a strategy that reduces the risk of downtime and reduced operations. IT professionals who design and deploy highly available systems use the following guiding principles to meet their goals:

  • 消除各個容錯網域和各個可能層級 (作業系統、軟體及 SharePoint 應用程式) 整體系統的單一失敗點。Eliminate single points of failure for each fault domain and the entire system at every possible layer (the operating system, software and the SharePoint application).

  • 執行超快速錯誤偵測、隔離及解決方案。Implement very rapid fault detection, isolation, and resolution.

高可用性解決方案的範圍很廣,可提供一套全系統的共用資源,經過整合後能提供預先定義的必要服務。此解決方案採取不同軟硬體組合,可在系統或部分系統故障時將停機時間降到最低,並還原服務。High availability solutions are broad in scope and provide a set of system-wide, shared resources that are integrated to provide predefined required services. The solution uses different combinations of hardware and software to minimize downtime and restore services when the system or part of the system fails.

容錯解決方案以硬體為主,採用特定硬體偵測錯誤並即時切換到備援硬體元件。此元件可以是處理器、記憶板、電源供應器、I/O 子系統或儲存子系統。切換到備援元件的方式有助於提高服務等級。A fault-tolerant solution is hardware-centric and uses specialized hardware to detect faults and instantly switch to a redundant hardware component. This component can be a processor, memory board, power supply, I/O subsystem, or storage subsystem. The switch to a redundant component provides a high level of service.

組織可參照容錯解決方案和高可用性解決方案的成本效益分析來擬定有效策略,以期符合 SharePoint 伺服器陣列的可用性目標。通常這兩項解決方案之間會有成本上的權衡。A cost-benefits analysis of fault-tolerant solutions and high availability solutions enables organizations to create an effective strategy to meet the availability goals for their SharePoint farm. Typically there are cost tradeoffs between the two solutions.

對於 SharePoint 伺服器陣列而言,執行高可用性成本的程序是較為昂貴的一項投資。當可用性等級和想提高可用性的系統數目增加時,可用性解決方案的複雜度和成本也會隨之增加。A process that implements high availability is one of the more expensive investments for a SharePoint farm. As the level of availability and the number of systems that you want to make highly available increases, complexity and cost of an availability solution also increases.

而精進虛擬化技術則可讓組織使用虛擬電腦作為熱備用、暖備用及冷備用。虛擬電腦可能更適合提供同樣的功能。虛擬化具備彈性和成本效益。不過您必須確認虛擬機器有足夠容量處理即將更換的實體電腦負載。Advances in virtualization technology enable organizations to use virtual computers as hot, warm, or cold spares. Virtual computers may be suitable to provide the same functionality. Virtualization can provide flexibility and cost efficiency. However, you must verify that a virtual machine has the capacity to handle the load of the physical computer that it will replace.

建立支援高可用性的伺服器陣列架構Create a farm architecture that supports high availability

下列圖例說明如何散佈及設定不同部分的 SharePoint 環境來提升伺服器陣列的可用性。此範例亦說明備援如何解決容錯網域。The following illustration shows how you can distribute and configure different parts of a SharePoint environment to increase availability across a farm. This example also shows how redundancy can address fault domains.

注意

我們提供的範例並不完整。舉例來說,此範例並未顯示所有容錯網域和容錯硬體。Our example is not comprehensive. For example it does not show all the fault domains and fault-tolerant hardware.

伺服器拓撲備援解決失敗點的範例Examples of redundancy in a farm topology to address points of failure

這個伺服器陣列範例顯示如何使用重複的角色與服務來處理單一失敗點。請參閱下列清單以獲得詳細資訊。

請參閱前述圖例的拓撲,並注意下列事項:Referring to the topology in the previous illustration, note the following:

  • 本範例中的陣列伺服器可以是部署在 Hyper-V 主機伺服器的實體電腦或虛擬機器。識別與回應失敗點的原則均適用於這兩種環境。The farm servers in this example can be physical computers or virtual machines that are deployed on Hyper-V host servers. The principle of identifying and responding to points of failure applies to both types of environment.

  • 由四部伺服器 (W1-W4) 專門提供內容,而且如果有一或多部伺服器發生失敗,此備援即可提高可用性。套用軟體更新時,此備援等級也可協助讓伺服器陣列持續運作。Four servers (W1-W4) are dedicated to serving content and this redundancy increases availability if a failure occurs in one or more servers. This level of redundancy also enables the farm to continue operations when software updates are applied.

  • 由四部應用程式伺服器 (A1-A4) 提升伺服器陣列服務的可用性和搜尋等特定應用程式元件。以搜尋角色和元件為備援。Four application servers (A1-A4) increase availability for farm services and specific application components such as search. Search roles and components are redundant.

  • 以伺服器陣列資料庫伺服器為備援,而且使用資料庫鏡像或叢集,可達到資料庫高可用性。The farm database servers are redundant and database high availability can be achieved by using database mirroring or clustering.

  • 在虛擬環境中,會將虛擬機器設置在獨立的 Hyper-V 主機伺服器中,藉此消除單一失敗點。這項設置虛擬機器的方式係遵照可用性與效能的最佳作法指引。In a virtual environment the virtual machines are put on separate Hyper-V host servers to eliminate a single point of failure. This approach to virtual machine placement follows best practice guidelines for availability and performance.

  • 將涵蓋兩部虛擬化主機電腦的主要資料庫伺服器 (標示為 1) 和機架 2 (標示為 2) 識別為容錯網域,以顯示如何將伺服器陣列和基礎結構視為一個容錯網域集合。此方式顯示您可以如何深入分析環境,以便研擬完整策略和成本效益分析。The primary database server (labeled 1) and Rack 2 (labeled 2), that contains two of the virtualization host computers, are identified as fault domains to show how your farm and infrastructure can be viewed as a collection of fault domains. This shows how you can do an in-depth analysis of your environment to develop an overall strategy and cost benefit analysis.

其他伺服器陣列角色和服務Other farm roles and services

我們的範例不包含可能在特定 SharePoint 伺服器陣列中執行的所有角色、服務以及服務應用程式。您無法針對 SharePoint 伺服器陣列的一切使用一般方式達到高可用性。部分可使用標準方式達到高可用性的重要排除如下:Our example does not include all the roles, services, and service applications that might be running in a specific SharePoint farm. You cannot use a generic approach to high availability for everything in a SharePoint farm. Some important exclusions to using a standard approach to high availability are as follows:

在高可用性解決方案中使用容錯Use fault tolerance in your high availability solution

在設計出支援高可用性角色和工作量的架構後,您可以使用容錯元件提升可用性。容錯解決方案適用於整個基礎結構,其中包括資料庫。After you design an architecture that supports highly available roles and workloads, you can use fault-tolerant components to increase availability. Fault tolerant solutions are available across the infrastructure, which includes the databases.

容錯基礎結構A fault-tolerant infrastructure

容錯功能幾乎隨時適用於 SharePoint 伺服器陣列基礎結構中的每個硬體元件。請在您的高可用性設計中,從運作和成本觀點決定應具備容錯功能的基礎結構部分。由於您可以讓基礎結構各個部分都具備容錯功能,但不表示一定需要如此。Fault tolerance is readily available for almost every hardware component in the infrastructure of a SharePoint farm. As part of your high availability design, determine the parts of the infrastructure that should be fault-tolerant from an operational and cost perspective. Just because you can make every part of the infrastructure fault-tolerant doesn't mean that you should.

容錯資料庫伺服器和資料庫Fault tolerant database servers and databases

由於 SharePoint 平台及其應用程式工作量仰賴所有 SharePoint 資料庫的可用性和可靠性,因此高可用性資料庫對於高可用性策略而言是一個極度重要的環節。您可以利用下列功能作為 SharePoint 資料庫伺服器和資料庫的容錯解決方案:Because the SharePoint platform and its application workloads depend on the availability and reliability of all the SharePoint databases, highly available databases are an extremely important aspect of your high availability strategy. You can use the following features as fault-tolerant solutions for SharePoint database servers and databases:

  • SQL Server 容錯移轉叢集 (在 SQL Server 2014 Service Pack 1 (SP1) 中的 AlwaysOn 容錯移轉叢集執行個體 (FCI)) 和 SQL Server 2012SQL Server failover clustering (AlwaysOn Failover Cluster Instances (FCI) in SQL Server 2014 with Service Pack 1 (SP1)) and SQL Server 2012

  • AlwaysOn 可用性群組AlwaysOn Availability Groups

  • SQL Server 高可用性資料庫鏡像SQL Server high-availability database mirroring

關於 AlwaysOn 容錯移轉叢集執行個體和 AlwaysOn 可用性群組About AlwaysOn Failover Cluster Instances and AlwaysOn Availability Groups

容錯移轉叢集在兩部電腦之間需要有共用的磁碟儲存體。在兩個設定節點中,會將這兩部電腦設定為主動/被動,以便提供主要節點的完整備援執行個體。只有在主要節點失敗時,被動節點才會上線運作。共用磁碟一次只會顯示給一部電腦。此設定通常需要大部分的其他硬體。在 SQL Server 2014 (SP1) 和 SQL Server 2012 中,這類的叢集設定即是一個 AlwaysOn 容錯移轉叢集執行個體,而且是安裝 SQL Server 的一項特定方式。由於設定需求關係,您無法採用標準的 SQL Server 安裝並輕鬆地將其變更成容錯移轉叢集執行個體。A failover cluster requires shared disk storage between two computers. In a two node configuration, the computers are configured as active/passive which provides a fully redundant instance of the primary node. The passive node is only brought online when the primary node fails. The shared disk is only presented to one computer at a time. This configuration typically requires the most additional hardware. In SQL Server 2014 (SP1) and SQL Server 2012, this type of cluster configuration is an AlwaysOn Failover Cluster Instance, and it is a specific way to install SQL Server. Because of the configuration requirements, you cannot take a standard SQL Server installation and easily change it to a Failover Cluster Instance.

AlwaysOn 可用性群組是 SQL Server 2014 (SP1) 和 SQL Server 2012 中的另一項技術 (將其視為資料庫鏡像的下階),並採用 Windows 叢集公開的部分功能。不過此技術並不需要共用磁碟儲存體,而且可用性群組中的電腦不必安裝 SQL Server 的特定設定。資料庫伺服器新增至 Windows 叢集後,便可相當輕鬆地啟用 AlwaysOn 可用性群組,接著再設定需要的可用性群組。An AlwaysOn Availability Group is a different technology in SQL Server 2014 (SP1) and SQL Server 2012 (think of it as a descendant of Database Mirroring) that uses some features exposed by Windows Clustering. However, it does not require shared disk storage, and the computers in an availability group do not have to have a specialized configuration of SQL Server installed on them. After a database server is added to a Windows Cluster, it is fairly easy to enable AlwaysOn Availability Groups and then configure the availability group that you want.

總之,任何執行 SQL Server 2014 (SP1) 和 SQL Server 2012 企業版的伺服器都能夠以加入叢集並設定可用性群組的方式,來使用 AlwaysOn 可用性群組。AlwaysOn 容錯移轉叢集需採用特殊硬體和設定步驟來設定容錯移轉叢集執行個體。每項技術都有其適用特定環境的用途,而且也會彼此競爭。如需這些功能的相關詳細資訊,請參閱<高可用性解決方案 (SQL Server)>。如需該使用哪種 SQL Server 可用性技術方面的協助,請參閱<選擇 SQL Server 可用性技術>。In summary, any server that runs SQL Server 2014 (SP1) and SQL Server 2012 Enterprise Edition can use AlwaysOn Availability Groups by joining a cluster and configuring the availability group. AlwaysOn failover clusters require special hardware and configuration steps to set up Failover Cluster Instances. Each of these technologies has its use for specific environments, and both are complimentary competitors. For more information about these features, see High Availability Solutions (SQL Server). For help deciding which SQL Server availability technology to use, see Choosing a SQL Server Availability Technology.

重要

由於每個 SQL Server 高可用性選項有其專屬功能、優勢及缺點,因此單一選項不見得會比其他選項卓越。舉例來說,在使用 AlwaysOn 可用性群組的指定狀況中,比起 AlwaysOn 容錯移轉叢集執行個體所能獲得的效能,將資料遺失情形降到最低可能會更加妥當。您必須依據業務需求和 IT 基礎結構需求選擇高可用性解決方案。Because each SQL Server high availability option has its own features, strengths, and weaknesses, one option is not necessarily better than another. For example, in a given scenario that uses AlwaysOn Availability Groups, minimizing data lose might be better than any performance gain that AlwaysOn Failover Cluster Instances achieves. You must choose a high-availability solution that is based on your business requirements and IT infrastructure requirements.

選擇要使用的 SQL Server 選項之決定性要素便是 SharePoint 資料庫。您必須了解 SharePoint Server 資料庫的特性。每個資料庫的特定需求或限制將決定 SQL Server 容錯解決方案是否適合或完全支援您的實際執行環境。建議您閱讀下列文章:A determining factor in selecting a SQL Server option to use is the SharePoint databases. You must understand the characteristics of the SharePoint Server databases. Each database may have specific requirements or constraints that will determine the SQL Server fault-tolerant solution that is appropriate and fully supported in your production environment. We recommend that you review the following articles:

SQL Server 容錯移轉叢集 SQL Server failover clustering

容錯移轉叢集為 SQL Server 2014 (SP1) 上的 SQL Server 或 SQL Server 2012 執行個體提供可用性支援。Failover clustering provides availability support for an instance of SQL Server on SQL Server 2014 (SP1) or SQL Server 2012.

容錯移轉叢集結合了一或多項節點或伺服器,以及二或多個共用磁碟。雖然容錯移轉叢集的執行個體會顯示為單一電腦,但如果目前節點無法使用,該執行個體也可在各節點之間提供容錯移轉。SharePoint Server 可在執行於 SQL Server 支援叢集中的各種主動和被動節點組合。A failover cluster is a combination of one or more nodes or servers, and two or more shared disks. Although an instance of a failover cluster appears as a single computer, the instance provides failover from one node to another if the current node becomes unavailable. SharePoint Server can run on any combination of active and passive nodes in a cluster that SQL Server supports.

SharePoint Server 將此叢集視為單一個體。因此從 SharePoint Server 的觀點來看,容錯移轉為自動而且一致。SharePoint Server references the cluster as a whole. Therefore, failover is automatic and seamless from the perspective of SharePoint Server.

注意

從一個叢集節點轉換到另一個時,若發生計劃或非計劃的容錯移轉,會造成連線中斷且必須重新建立連線。When either a planned or unplanned failover happens, connections are dropped and must be established again when transitioning from one cluster node to another cluster node.

如需有關 SQL Server 容錯移轉叢集的詳細資訊,請參閱<AlwaysOn 容錯移轉執行個體 (SQL Server)>。For detailed information about SQL Server failover clustering, see AlwaysOn Failover Cluster Instances (SQL Server).

SQL Server AlwaysOn 可用性群組和 SQL Server 資料庫鏡像SQL Server AlwaysOn Availability Groups and SQL Server Database Mirroring

SQL Server AlwaysOn 可用性群組和 SQL Server 資料庫鏡像的關鍵優勢在於,這兩者都能夠依據處理交易時的設定方式,提供完整或幾乎完整的資料備援。除了將資料遺失情形降到最低之外,自動容錯移轉也可降低實際執行資料庫的停機時間。The key benefit of SQL Server AlwaysOn Availability Groups and SQL Server Database Mirroring is that both provide complete or almost complete data redundancy depending on how you configure them for transaction processing. In addition to minimizing data loss, automatic failover minimizes downtime for production databases.

重要

雖然 SQL Server 2016、SQL Server 2014 (SP1) 和 SQL Server 2012 支援資料庫鏡像,但此功能已計劃要淘汰。建議您在新的開發工作中避免使用此功能,並規劃變更目前使用此功能的應用程式。請使用 AlwaysOn 可用性群組。Although SQL Server 2016, SQL Server 2014 (SP1), and SQL Server 2012 support database mirroring, this feature is planned to be deprecated. We recommend that you avoid using this feature in new development work. Plan to change applications that currently use this feature. Use AlwaysOn Availability Groups instead.

AlwaysOn 可用性群組AlwaysOn Availability Groups

SQL Server AlwaysOn 可用性群組的特色在於是一項能夠為資料庫鏡像提供企業級替代方案的高可用性和災害復原解決方案。AlwaysOn 可用性群組支援容錯移轉環境,適用於涵蓋在使用者定義集合中的一或多個使用者資料庫。此集合 (即可用性群組) 包含下列要素:The SQL Server AlwaysOn Availability Groups feature is both a high-availability and disaster-recovery solution that provides an enterprise-level alternative to database mirroring. AlwaysOn Availability Groups supports a failover environment for one or more user databases contained in a user-defined collection. This collection, an availability group, consists of the following components:

  • 複本,此為一組名稱為可用性資料庫的離散使用者資料庫,可當成單一單位處理。每個可用性群組都支援一個主要複本且最多可支援四個次要複本。Replicas, which are a discrete set of user databases called availability databases that are handled as a single unit. An availability group supports one primary replica and up to four secondary replicas.

  • SQL Server 的特定執行個體,可主控每個複本以及維護每個隸屬於可用性群組之資料庫的本機複本。A specific instance of SQL Server to host each replica and to maintain a local copy of each database that belongs to the availability group.

當可用性群組容錯移轉至目標執行個體或目標伺服器時,群組中的所有資料庫也會進行容錯移轉。因為 SQL Server 2014 (SP1) 和 SQL Server 2012 可以在單一伺服器上主控多個可用性群組,所以您可以將 AlwaysOn 設定為容錯移轉至不同伺服器上的 SQL Server 執行個體。這樣能夠減少閒置高效能待命伺服器來處理完全載入主要伺服器的需求,此為可用性群組的許多優點之一。When an availability group fails over to a target instance or target server, all databases in the group also fail over. Because SQL Server 2014 (SP1) and SQL Server 2012 can host multiple availability groups on a single server, you can configure AlwaysOn to fail over to SQL Server instances on different servers. This reduces the need for idle, high-performance standby servers to handle the full load of the primary server, which is one of the many benefits of availability groups.

注意

資料庫問題 (例如,因為資料檔遺失、資料庫刪除或交易記錄毀損而變成有疑問的資料庫 ) 不會導致容錯移轉。Database issues, such as a database becoming suspect due to a loss of a data file, deletion of a database, or corruption of a transaction log do not cause a failover.

如需 AlwaysOn 可用性群組之優點的詳細資訊及 AlwaysOn 可用性群組詞彙的概觀,請參閱<AlwaysOn 可用性群組 (SQL Server)>。For more information about the benefits of AlwaysOn Availability Groups and an overview of AlwaysOn Availability Groups terminology, see AlwaysOn Availability Groups (SQL Server).

資料庫鏡像Database mirroring

注意

雖然 SQL Server 2016、SQL Server 2014 (SP1) 和 SQL Server 2012 支援資料庫鏡像,但此功能已計劃要淘汰。建議您在新的開發工作中避免使用此功能,並規劃變更目前使用此功能的應用程式。請使用 AlwaysOn 可用性群組。Although SQL Server 2016, SQL Server 2014 (SP1), and SQL Server 2012 support database mirroring, this feature is planned to be deprecated. We recommend that you avoid using this feature in new development work. Plan to change applications that currently use this feature. Use AlwaysOn Availability Groups instead.

資料庫鏡像以保有主要資料庫伺服器中資料庫鏡像複本的方式,提供資料庫備援。鏡像會在每個資料庫上執行,而且只會搭配採用完整復原模式的資料庫使用。Database mirroring provides database redundancy by keeping a mirrored copy of databases on the primary database server. Mirroring is implemented on a per-database basis and only works with databases that use the full recovery model.

注意

鏡像作業模式共有兩種。其中一個是支援同步作業的高安全性模式。在高安全性模式下,當工作階段開始時,鏡像伺服器會儘快同步處理鏡像資料庫和主體資料庫。一旦資料庫同步處理完畢後,交易就會寫入次要伺服器的記錄中並重新執行。(一旦強化交易後,控制項就會返回主體伺服器。) 另一個鏡像模式是高效能,採用非同步作業減少交易延遲,但可能增加資料遺失情形。There are two mirroring operating modes. One of them, high-safety mode, supports synchronous operation. In high-safety mode, when a session starts, the mirror server synchronizes the mirror database and the principal database as quickly as possible. As soon as the databases are synchronized, a transaction is written to the log on the secondary server and then replayed. (Control returns to the principal server as soon as the transaction is hardened.) The other mirroring mode is high-performance, which uses asynchronous operation to reduce transaction latency, at the cost of increased data loss.

若是 SharePoint 伺服器陣列中的高可用性鏡像,您必須使用具備自動容錯移轉功能的高安全性模式。高安全性資料庫鏡像需要三種伺服器執行個體:主體、鏡像及見證。見證伺服器可讓 SQL Server 從主體伺服器自動容錯移轉至鏡像伺服器。從主體資料庫容錯移轉至鏡像資料庫通常需要幾秒的時間。For high-availability mirroring in a SharePoint farm, you must use high-safety mode with automatic failover. High-safety database mirroring requires three server instances: a principal, a mirror, and a witness. The witness server enables SQL Server to automatically fail over from the principal server to the mirror server. Failover from the principal database to the mirror database typically takes several seconds.

如需資料庫鏡像的一般資訊,請參閱<資料庫鏡像>。For general information about database mirroring, see Database Mirroring.

重要

設定使用 SQL Server FILESTREAM 遠端 BLOB (二進位大型物件) 存放區提供者的資料庫無法使用鏡像。Databases that are configured to use the SQL Server FILESTREAM remote BLOB store provider cannot be mirrored.

比較單一伺服器陣列的資料庫可用性和復原策略Comparison of database availability and recovery strategies for a single farm

會針對高可用性和資料復原選用 SQL Server 技術,應該是依據組織對於目標復原時點 (RPO) 和目標復原時間 (RTO) 的業務目標而選。雖然 RPO 和 RTO 通常與災害復原有關,但部分失敗事件則不屬於災害範圍,而是需要從主體資料中心的本機備份媒體中復原。The choice of a SQL Server technology for high availability and disaster recovery should be based on your organization's business goals for Recovery Point Objective (RPO) and Recovery Time Objective (RTO). Although RPO and RTO are typically associated with disaster recovery, some failure events are outside the scope of a disaster but require recovery from local backup media in the primary datacenter.

重要

根據特定資料庫,各種 SharePoint Server 資料庫僅支援特定的 SQL Server 高可用性選項。如需詳細資訊,請參閱<SharePoint 資料庫支援的高可用性和災害復原選項>。Depending on the specific database, the various SharePoint Server databases only support specific SQL Server high availability options. For more information, see Supported high availability and disaster recovery options for SharePoint databases.

下表依據 SQL Server 可用解決方案能達到的 RPO 和 RTO 結果提供一般比較。The following table provides a general comparison of the RPO and RTO results that available SQL Server solutions achieve.

注意

下表中的時間是為了比較資料庫選項。在實際情況中,所有時間會依據工作量、資料磁碟區及容錯移轉程序而定。Times in the following table are for comparing database options. In practice, all times depend on the workload, data volume, and failover procedures.

依據資料庫技術比較 RPO 和 RTORPO and RTO comparison based on database technology

SQL Server 解決方案SQL Server solution 可能遺失資料 (RPO)Potential data loss (RPO) 可能復原時間 (RTO)Potential recovery time (RTO) 自動容錯移轉Automatic failover 可讀取次要
**Note:
SharePoint Server 支援可在執行階段使用的可讀取的第二個複本。如需詳細資訊,請參閱< 2014 年 4 月的 Office 2013 累計更新>和<在 SharePoint Server 中執行使用唯讀資料庫的伺服器陣列>。
Readable secondaries
Note: SharePoint Server supports readable secondary replicas for runtime usage. For more information, see Office 2013 cumulative update for April 2014 and Run a farm that uses read-only databases in SharePoint Server.**
AlwaysOn 可用性群組 (同步認可)AlwaysOn Availability Group (synchronous-commit)
Zero
Seconds
Yes
0 - 20 - 2
AlwaysOn 可用性群組 (非同步認可)AlwaysOn Availability Group (asynchronous-commit)
Seconds
分鐘Minutes
No
0 - 40 - 4
AlwaysOn 容錯移轉叢集執行個體AlwaysOn Failover Cluster Instance
不適用Does not apply
FCI 本身不具備資料保護功能。資料遺失量需視儲存系統實作而定。An FCI itself does not provide data protection. The amount of data loss depends on the storage system implementation.
秒至分鐘Seconds to minutes
Yes
不適用Does not apply
資料庫鏡像 - 高安全性 (同步模式 + 見證伺服器)Database mirroring - High-safety (synchronous mode + witness server)
Zero
Seconds
Yes
不適用Does not apply
資料庫鏡像 - 高效能 (非同步模式)Database mirroring - High-performance (asynchronous mode)
Seconds
分鐘Minutes
No
不適用Does not apply
備份、複製、還原Backup, copy, restore
若失敗後可存取記錄結尾,則為數小時或零。Hours or zero if the tail of the log can be accessed after the failure.
數小時至數天Hours to days
No
還原時沒有Not during a restore

比較 SQL Server 叢集、AlwaysOn 可用性群組及資料庫鏡像Comparison of SQL Server Cluster, AlwaysOn Availability Group and Database mirror

程序Process SQL Server 容錯移轉叢集SQL Server failover cluster SQL Server 2014 (SP1) 和 SQL Server 2012 AlwaysOn 可用性群組SQL Server 2014 (SP1) and SQL Server 2012 AlwaysOn Availability Group SQL Server 高可用性鏡像SQL Server high-availability mirror
容錯移轉時機Time to fail over
失敗後叢集成員幾乎會立即接管。當叢集節點加速時,會發生延遲。Cluster member takes over almost immediately after failure. A lag occurs while the cluster node spins up.
失敗後複本幾乎會立即接管。當次要複本加速時,會發生延遲。Replica takes over almost immediately after failure. A lag occurs while the secondary replica spins up.
一旦處理重做佇列,鏡像就會接管。Mirror takes over as soon as the redo queue is processed.
交易一致性Transactional consistency
Yes
Yes
Yes
交易並行Transactional concurrency
Yes
Yes
Yes
復原時機Time to recovery
比起可用性群組,復原時間更短。Shorter time to recover than an availability group.
比起容錯移轉叢集,復原時間更長,但比起鏡像解決方案,復原時間更快。Longer time to recover than a failover cluster, but faster recovery time than a mirrored solution.
比起叢集或可用性群組,復原時間稍長。Slightly longer time to recover than cluster or availability group.
容錯移轉所需採取的步驟Steps required for failover
資料庫節點自動偵測失敗。Database nodes automatically detect a failure.
SharePoint Server 參考叢集,因此容錯移轉一致且自動。SharePoint Server references the cluster so that failover is seamless and automatic.
可用性群組接聽程式會自動偵測失敗,且容錯移轉一致且自動。The Availability Group listener automatically detects a failure and failover is seamless and automatic.
資料庫會自動偵測失敗。The database automatically detects failure.
SharePoint Server 設定正確時會知曉鏡像位置,則容錯移轉屬於自動。SharePoint Server is aware of the mirror location, if it was configured correctly so that failover is automatic.
提供保護,避免失敗儲存Protection against failed storage
容錯移轉叢集本身不具備資料保護功能。資料遺失量需視儲存系統實作而定。例如 SAN 環境有多個檔案路徑、RAID 及熱備用等備援要素。The failover cluster itself does not provide data protection. The amount of data loss depends on the storage system implementation. For example, a SAN environment has redundant components such as multiple file paths, RAID, and hot spares.
提供保護,避免失敗儲存,原因是主要複本會寫入次要複本中的本機磁碟。Protects against failed storage because the primary replica writes to the local disks on the secondary replicas.
提供保護,避免失敗儲存,原因是主體和鏡像資料庫伺服器會寫入本機磁碟。Protects against failed storage because both the principal and mirror database servers write to local disks.
支援的儲存類型Storage types supported
需要比專屬儲存更為昂貴的共用儲存。Requires shared storage which is more expensive than dedicated storage.
可使用較不昂貴的直接附加儲存解決方案。Can use less expensive directly attached storage solutions.
可使用較不昂貴的直接附加儲存。Can use less expensive directly attached storage.
位置需求Location requirements
叢集的成員必須在相同的子網路上。 Members of the cluster must be on the same subnet.
Note: 這不適用於 SQL Server 2014 (SP1) 和 SQL Server 2012。Note: This is not the case with SQL Server 2014 (SP1) and SQL Server 2012.
只要延遲不會造成效能問題,複本便可位於不同子集。Replicas can be on different subnets as long as latency does not cause performance issues.
主體、鏡像及見證伺服器必須位於同一個 LAN (來回最高達 1 毫秒延遲)。Principal, mirror, and witness servers must be on the same LAN (up to 1 millisecond latency round-trip).
復原模式Recovery model
建議使用 SQL Server 完整復原模式。您可以使用 SQL Server 簡易復原模式。不過如果叢集遺失,唯一可用的復原點將是上次的完整備份。SQL Server full recovery model recommended. You can use the SQL Server simple recovery model. However, the only available recovery point if the cluster is lost will be the last full backup.
需要 SQL Server 2014 (SP1) 和 SQL Server 2012 完整復原模式。Requires SQL Server 2014 (SP1) and SQL Server 2012 full recovery model.
需要使用 SQL Server 完整復原模式。Requires SQL Server full recovery model.
效能負荷Performance overhead
進行容錯移轉時,可能會發生效能降低情形。容錯移轉時伺服器將會無法使用,而連線也會中斷,因此請於新主動節點中重新建立。Some decrease in performance may occur while a failover is occurring. The server will be unavailable during failover and connections are dropped and then established again on the new active node.
由於次要複本上有同步認可,因此 AlwaysOn 可用性群組會存有交易延遲。延遲量會依據必須進行同步處理的次要複本量而定。AlwaysOn Availability Groups introduce transactional latency because of synchronous commit on the secondary replicas. The amount of latency depends on the number of secondary replicas that have to be synchronized.
記憶體和處理器負荷大於叢集,但小於鏡像,Memory and processor overhead is greater than clustering, but less than mirroring.
高可用性鏡像因為同步,所以存有交易延遲,同時也需要額外記憶體和處理器負荷。High-availability mirroring introduces transactional latency because it is synchronous. It also requires additional memory and processor overhead.
作業負荷Operations overhead
設定並維持在伺服器等級。Set up and maintained at the server level.
作業負荷大於叢集和鏡像。除了 Windows Server 等級,AlwaysOn 還需要 SQL Server 資料庫伺服器等級的負荷。 The operational overhead is greater than clustering and mirroring. AlwaysOn requires overhead at the level of the SQL Server database server in addition to the Windows Server level.
附註: 登入和代理程式作業等伺服器等級物件必須手動維護。Note: Server-level objects such as logons and agent jobs must be maintained manually.
如果新增內容資料庫,必須將其新增至可用性群組,並將主要複本同步處理至次要複本。If you add content databases, you have to add them to an availability group and then synchronize the primary replica to the secondary replicas.
SharePoint 伺服器陣列環境需要多個設定步驟,才能確保 SharePoint Server 連線字串與可用性群組接聽程式名稱建立正確關聯。A SharePoint farm environment requires multiple configuration steps to make sure that the SharePoint Server connection string is correctly associated with the availability group listener name.
作業負荷大於叢集。必須設定及維護所有資料庫。容錯移轉後手動重新設定。The operations overhead is more than clustering. Must be set up and maintained for all databases. Reconfiguring after failover is manual.
附註: 登入和代理程式作業等伺服器等級物件必須手動維護。Note: Server-level objects such as logons and agent jobs must be maintained manually.
如果新增內容資料庫,必須將其新增至主體,並將主體同步處理至鏡像。If you add content databases, you have to add them to the principal and then synchronize the principal to the mirror.

將兩個資料中心設定為單一伺服器陣列 (「延伸的」伺服器陣列),以提供高可用性Configure two data centers as a single farm ("stretched" farm) to provide high availability

有些企業的各資料中心位置非常接近,並透過高頻寬光纖連結加以連接。當這類環境可供使用時,就可能將兩個資料中心設為單一伺服器陣列。這樣的分散式伺服器陣列拓撲稱為「延伸的」伺服器陣列。Some enterprises have data centers that are located in close proximity to one another, connected by high-bandwidth fiber optic links. When this environment is available it is possible to configure the two data centers as a single farm. This distributed farm topology is called a "stretched" farm.

若要將延伸的伺服器陣列架構當作支援的高可用性解決方案使用,必須符合下列前提:For stretched farm architecture to work as a supported high availability solution the follow prerequisites must be met:

  • <1ms (單向) 擁有高度一致的內部伺服器陣列延遲,有 99.9% 的時間超過十分鐘。(內部伺服器陣列延遲通常定義為前端網頁伺服器和資料庫伺服器之間的延遲。)There is a highly consistent intra-farm latency of <1ms (one way), 99.9% of the time over a period of ten minutes. (Intra-farm latency is commonly defined as the latency between the front-end web servers and the database servers.)

  • 頻寬速度必須至少每秒 1 Gigabit。The bandwidth speed must be at least 1 gigabit per second.

如要提供延伸伺服器陣列的容錯能力,請使用標準最佳作法指導設定備援服務應用程式和資料庫。To provide fault tolerance in a stretched farm, use the standard best practice guidance to configure redundant service applications and databases.

下列圖例顯示延伸的伺服器陣列。The following illustration shows a stretched farm.

延伸的伺服器陣列Stretched farm

使用兩個資料中心來提供高可用性的延伸伺服器陣列拓撲。

將備份與還原作業納入高可用性策略Incorporate backup and restore operations in a high availability strategy

您的高可用性策略必須包含適當的備份和還原作業,方可確保 SharePoint 伺服器陣列的靈活度。發生媒體失敗或使用者錯誤等事件時,必須能夠即時還原伺服器陣列環境或伺服器陣列資料中受影響的部分。有效的備份和還原解決方案應該能夠讓您達到定義的目標復原時間 (RTO) 和目標復原時點 (RPO)。Your high availability strategy must include the appropriate backup and restore operations to make sure that the SharePoint farm is resilient. When an incident, such as a media failure or user error occurs, you must be able to restore the affected part of the farm environment or farm data in a timely manner. An effective backup and restore solution should enable you to meet the Recovery Time Objectives (RTO) and Recovery Point Objectives (RPO) that you define.

另請參閱See also

概念Concepts

SharePoint Server 的高可用性與災害復原概念High availability and disaster recovery concepts in SharePoint Server

選擇 SharePoint Server 的災害復原策略Choose a disaster recovery strategy for SharePoint Server