AlwaysOn 容錯移轉叢集執行個體 (SQL Server)Always On Failover Cluster Instances (SQL Server)

Always On 容錯移轉叢集執行個體是 [SQL Server]SQL Server Always On 供應項目的一部分,會利用 Windows Server 容錯移轉叢集 (WSFC) 功能,透過伺服器執行個體層級 (「容錯移轉叢集執行個體」 (FCI)) 的備援提供本機高可用性。As part of the [SQL Server]SQL Server Always On offering, Always On Failover Cluster Instances leverages Windows Server Failover Clustering (WSFC) functionality to provide local high availability through redundancy at the server-instance level-a failover cluster instance (FCI). FCI 是跨 Windows Server 容錯移轉叢集 (WSFC) 節點且可能跨多個子網路安裝的單一 [SQL Server]SQL Server 執行個體。An FCI is a single instance of [SQL Server]SQL Server that is installed across Windows Server Failover Clustering (WSFC) nodes and, possibly, across multiple subnets. 在網路上,FCI 看似單一電腦上的 [SQL Server]SQL Server 執行個體,但是 FCI 提供容錯移轉,可以在目前的 WSFC 節點無法使用時,從該節點容錯移轉到另一個節點。On the network, an FCI appears to be an instance of [SQL Server]SQL Server running on a single computer, but the FCI provides failover from one WSFC node to another if the current node becomes unavailable.

FCI 可以利用 AlwaysOn 可用性群組提供資料庫層級的遠端災害復原。An FCI can leverage Always On Availability Groupsto provide remote disaster recovery at the database level. 如需詳細資訊,請參閱容錯移轉叢集和 AlwaysOn 可用性群組 (SQL Server)For more information, see Failover Clustering and Always On Availability Groups (;SQL Server);.

注意

SQL Server 2014SQL Server 2014 開始,AlwaysOn 容錯移轉叢集執行個體在 Windows Server 2008 R2Windows Server 2008 R2Windows Server 2012Windows Server 2012 中都支援叢集共用磁碟區 (CSV)。Beginning in SQL Server 2014SQL Server 2014, Always On Failover Cluster Instances supports Clustered Shared Volumes (CSV) in both Windows Server 2008 R2Windows Server 2008 R2 and Windows Server 2012Windows Server 2012. 如需有關 CSV 的詳細資訊,請參閱 了解容錯移轉叢集的叢集共用磁碟區For more information on CSV, see Understanding Cluster Shared Volumes in a Failover Cluster.

本主題內容:In this Topic:

容錯移轉叢集執行個體的優點Benefits of a Failover Cluster Instance

伺服器的硬體故障或軟體失敗時,連接至伺服器的應用程式或用戶端可能會停機。When there is hardware or software failure of a server, the applications or clients connecting to the server will experience downtime. [SQL Server]SQL Server 執行個體設定成 FCI (而不是獨立執行個體) 時,該 [SQL Server]SQL Server 執行個體的高可用性會受到 FCI 中存在的重複節點保護。When a [SQL Server]SQL Server instance is configured to be an FCI (instead of a standalone instance), the high availability of that [SQL Server]SQL Server instance is protected by the presence of redundant nodes in the FCI. 在任何時候,FCI 中僅其中一個節點擁有 WSFC 資源群組。Only one of the nodes in the FCI owns the WSFC resource group at a time. 如果發生失敗 (硬體故障、作業系統失敗、應用程式或服務失敗) 或進行計畫的升級,資源群組擁有權就會移至另一個 WSFC 節點。In case of a failure (hardware failures, operating system failures, application or service failures), or a planned upgrade, the resource group ownership is moved to another WSFC node. 此程序對連接至 [SQL Server]SQL Server 的用戶端或應用程式而言是透明的,而且會將應用程式或用戶端在失敗期間遭遇停機時間的機會降到最低。This process is transparent to the client or application connecting to [SQL Server]SQL Server and this minimize the downtime the application or clients experience during a failure. 下面列出 [SQL Server]SQL Server 容錯移轉叢集執行個體所提供的一些主要優點:The following lists some key benefits that [SQL Server]SQL Server failover cluster instances provide:

  • 透過備援性在執行個體層級提供保護Protection at the instance level through redundancy

  • 如果發生失敗 (硬體故障、作業系統失敗、應用程式或服務失敗) 時的自動容錯移轉Automatic failover in the event of a failure (hardware failures, operating system failures, application or service failures)

    重要

    在 AlwaysOn 可用性群組中,不支援從 FCI 自動容錯移轉至可用性群組中的其他節點。In an Always On availability group, automatic failover from an FCI to other nodes within the availability group is not supported. 這表示,如果自動容錯移轉是高可用性方案的重要元件,FCI 和獨立節點不應該在可用性群組內耦合。This means that FCIs and standalone nodes should not be coupled together within an availability group if automatic failover is an important component your high availability solution. 不過,這種耦合適用於「災害復原」方案。However, this coupling can be made for your disaster recovery solution.

  • 支援眾多儲存方案,包括 WSFC 叢集磁碟 (iSCSI、光纖通道等) 和伺服器訊息區塊 (SMB) 檔案共用。Support for a broad array of storage solutions, including WSFC cluster disks (iSCSI, Fiber Channel, and so on) and server message block (SMB) file shares.

  • 使用多重子網路 FCI 或在 AlwaysOn 可用性群組內執行一個 FCI 裝載資料庫的災害復原解決方案。Disaster recovery solution using a multi-subnet FCI or running an FCI-hosted database inside an Always On availability group. 利用 MicrosoftMicrosoftSQL Server 2012SQL Server 2012的新多重子網路支援,多重子網路 FCI 不再需要虛擬 LAN,提高了多重子網路 FCI 的管理能力和安全性。With the new multi-subnet support in MicrosoftMicrosoftSQL Server 2012SQL Server 2012, a multi-subnet FCI no longer requires a virtual LAN, increasing the manageability and security of a multi-subnet FCI.

  • 在容錯移轉期間,應用程式和用戶端的零重新組態Zero reconfiguration of applications and clients during failovers

  • 自動容錯移轉之細微觸發程序事件的彈性容錯移轉原則Flexible failover policy for granular trigger events for automatic failovers

  • 透過使用專用和保存連接的定期和詳細健全狀況偵測,可靠的容錯移轉Reliable failovers through periodic and detailed health detection using dedicated and persisted connections

  • 在容錯移轉時間透過間接背景檢查點的可設定性和可預測性Configurability and predictability in failover time through indirect background checkpoints

  • 在容錯移轉期間節流的資源使用情況Throttled resource usage during failovers

建議Recommendations

在實際執行環境中,我們建議您搭配容錯移轉叢集執行個體的虛擬 IP 位址使用靜態 IP 位址。In a production environment, we recommend that you use static IP addresses in conjunction the virtual IP address of a Failover Cluster Instance. 我們建議您不要在實際執行環境中使用 DHCP。We recommend against using DHCP in a production environment. 在停機時,如果 DHCP IP 租用過期,則需要額外的時間來重新註冊與 DNS 名稱相關聯的新 DHCP IP 位址。In the event of down time, if the DHCP IP lease expires, extra time is required to re-register the new DHCP IP address associated with the DNS name.

容錯移轉叢集執行個體概觀Failover Cluster Instance Overview

FCI 在具有一個或多個 WSFC 節點的 WSFC 資源群組中執行。An FCI runs in a WSFC resource group with one or more WSFC nodes. 當 FCI 啟動時,其中一個節點會取得資源群組擁有權,並使其 [SQL Server]SQL Server 執行個體上線。When the FCI starts up, one of the nodes assume ownership of the resource group and brings its [SQL Server]SQL Server instance online. 此節點所擁有的資源包括:The resources owned by this node include:

  • 網路名稱Network name

  • IP 位址IP address

  • 共用磁碟Shared disks

  • [SQL Server]SQL Server Database Engine 服務Database Engine service

  • [SQL Server]SQL Server Agent 服務Agent service

  • [SQL Server]SQL Server Analysis Services 服務 (如果已安裝)Analysis Services service, if installed

  • 一個檔案共用資源 (如果已安裝 FILESTREAM 功能)One file share resource, if the FILESTREAM feature is installed

在任何時候,僅資源群組擁有者在資源群組中執行其各自 [SQL Server]SQL Server 服務,FCI 中的其他節點並不執行。At any time, only the resource group owner (and no other node in the FCI) is running its respective [SQL Server]SQL Server services in the resource group. 當發生容錯移轉時,無論是自動容錯移轉或計畫的容錯移轉,就會依下列順序發生事件:When a failover occurs, whether it be an automatic failover or a planned failover, the following sequence of events happen:

  1. 除非發生硬體或系統失敗,否則在緩衝快取中的所有中途分頁都會寫入磁碟。Unless a hardware or system failure occurs, all dirty pages in the buffer cache are written to disk.

  2. 在使用中節點上資源群組的所有各自 [SQL Server]SQL Server 服務都會停止。All respective [SQL Server]SQL Server services in the resource group are stopped on the active node.

  3. 資源群組擁有權將轉移到 FCI 中的另一個節點。The resource group ownership is transferred to another node in the FCI.

  4. 新資源群組擁有者啟動其 [SQL Server]SQL Server 服務。The new resource group owner starts its [SQL Server]SQL Server services.

  5. 用戶端應用程式的連接要求自動導向至使用相同虛擬網路名稱 (VNN) 的新使用中節點。Client application connection requests are automatically directed to the new active node using the same virtual network name (VNN).

只要其基礎 WSFC 叢集保持良好的仲裁狀況 (多數仲裁 WSFC 節點可做為自動容錯移轉目標使用),FCI 就是線上狀態。The FCI is online as long as its underlying WSFC cluster is in good quorum health (the majority of the quorum WSFC nodes are available as automatic failover targets). 當 WSFC 叢集失去其仲裁時 (無論由於硬體、軟體、網路失敗或仲裁組態不正確),整個 WSFC 叢集與 FCI 就會離線。When the WSFC cluster loses its quorum, whether due to hardware, software, network failure, or improper quorum configuration, the entire WSFC cluster, along with the FCI, is brought offline. 在此未規劃的容錯移轉情況下,需要手動介入,在剩餘可用的節點中重新建立仲裁,以使 WSFC 叢集和 FCI 恢復連線。Manual intervention is then required in this unplanned failover scenario to reestablish quorum in the remaining available nodes in order to bring the WSFC cluster and FCI back online. 如需詳細資訊,請參閱 WSFC 仲裁模式和投票組態 (SQL Server)For more information, see WSFC Quorum Modes and Voting Configuration (;SQL Server);.

可預測的容錯移轉時間Predictable Failover Time

根據 [SQL Server]SQL Server 執行個體上次執行檢查點作業的時間,緩衝快取中可能有相當多的中途分頁。Depending on when your [SQL Server]SQL Server instance last performed a checkpoint operation, there can be a substantial amount of dirty pages in the buffer cache. 因此,容錯移轉的持續時間與剩餘中途分頁寫入磁碟所需的時間一樣長,這可能導致冗長且不可預測的容錯移轉時間。Consequently, failovers last as long as it takes to write the remaining dirty pages to disk, which can lead to long and unpredictable failover time. MicrosoftMicrosoftSQL Server 2012SQL Server 2012開始,FCI 可以使用間接檢查點,節流緩衝快取中保留的中途分頁數量。Beginning with MicrosoftMicrosoftSQL Server 2012SQL Server 2012, the FCI can use indirect checkpoints to throttle the amount of dirty pages kept in the buffer cache. 雖然在一般工作負載下這會耗用額外資源,但更能預測和設定容錯移轉時間。While this does consume additional resources under regular workload, it makes the failover time more predictable as well as more configurable. 當您組織的服務層級合約規定高可用性方案的復原時間目標 (RTO) 時,此功能非常有用。This is very useful when the service-level agreement in your organization specifies the recovery time objective (RTO) for your high availability solution. 如需有關間接檢查點的詳細資訊,請參閱< Indirect Checkpoints>。For more information on indirect checkpoints, see Indirect Checkpoints.

可靠的健全狀況監測和彈性的容錯移轉原則Reliable Health Monitoring and Flexible Failover Policy

在 FCI 成功啟動之後,WSFC 服務會監視基礎 WSFC 叢集和 [SQL Server]SQL Server 執行個體的健全狀況。After the FCI starts successfully, the WSFC service monitors both the health of the underlying WSFC cluster, as well as the health of the [SQL Server]SQL Server instance. MicrosoftMicrosoftSQL Server 2012SQL Server 2012開始,WSFC 服務使用專用連接,透過系統預存程序來輪詢使用中 [SQL Server]SQL Server 執行個體,以取得詳細元件診斷。Beginning with MicrosoftMicrosoftSQL Server 2012SQL Server 2012, the WSFC service uses a dedicated connection to poll the active [SQL Server]SQL Server instance for detailed component diagnostics through a system stored procedure. 這具有三方面的意義:The implication of this is three-fold:

  • [SQL Server]SQL Server 執行個體的專用連接可一直可靠地輪詢元件診斷,即使 FCI 負載過重也一樣。The dedicated connection to the [SQL Server]SQL Server instance makes it possible to reliably poll for component diagnostics all the time, even when the FCI is under heavy load. 這能夠區別負載過重的系統和實際發生失敗狀況的系統,因此防止假容錯移轉等問題發生。This makes it possible to distinguish between a system that is under heavy load and a system that actually has failure conditions, thus preventing issues such as false failovers.

  • 詳細元件診斷能夠設定更有彈性的容錯移轉原則,讓您可以選擇何種失敗條件觸發容錯移轉,何種失敗條件不觸發。The detailed component diagnostics makes it possible to configure a more flexible failover policy, whereby you can choose what failure conditions trigger failovers and which failure conditions do not.

  • 詳細的元件診斷也啟用自動容錯移轉更好的、追溯性的疑難排解。The detailed component diagnostics also enables better troubleshooting of automatic failovers retroactively. 診斷資訊儲存在記錄檔中,與 [SQL Server]SQL Server 錯誤記錄檔共置。The diagnostic information is stored to log files, which are collocated with the [SQL Server]SQL Server error logs. 您可以將它們載入記錄檔檢視器中,檢查容錯移轉發生前的元件狀態,以便判斷何種狀況導致該容錯移轉。You can load them into the Log File Viewer to inspect the component states leading up to the failover occurrence in order to determine what cause that failover.

如需詳細資訊,請參閱< Failover Policy for Failover Cluster InstancesFor more information, see Failover Policy for Failover Cluster Instances

容錯移轉叢集執行個體的元素Elements of a Failover Cluster Instance

FCI 是由一組實體伺服器 (節點) 所組成,包含相似硬體組態和相同軟體組態,包括作業系統版本和修補程式等級,以及 [SQL Server]SQL Server 版本、修補程式等級、元件和執行個體名稱。An FCI consists of a set of physical servers (nodes) that contain similar hardware configuration as well as identical software configuration that includes operating system version and patch level, and [SQL Server]SQL Server version, patch level, components, and instance name. 需要相同軟體組態,以確保 FCI 在節點之間容錯移轉時可完整運作。Identical software configuration is necessary to ensure that the FCI can be fully functional as it fails over between the nodes.

WSFC 資源群組WSFC Resource Group
[SQL Server]SQL Server FCI 在 WSFC 資源群組中執行。A [SQL Server]SQL Server FCI runs in a WSFC resource group. 資源群組中的每個節點都會維護組態設定和檢查點登錄機碼的同步副本,以確保在容錯移轉後 FCI 可完整運作,而且在任何時候叢集中僅其中一個節點 (使用中節點) 擁有資源群組。Each node in the resource group maintains a synchronized copy of the configuration settings and check-pointed registry keys to ensure full functionality of the FCI after a failover, and only one of the nodes in the cluster owns the resource group at a time (the active node). WSFC 服務管理伺服器叢集、仲裁組態、容錯移轉原則和容錯移轉作業,以及 FCI 的 VNN 和虛擬 IP 位址。The WSFC service manages the server cluster, quorum configuration, failover policy, and failover operations, as well as the VNN and virtual IP addresses for the FCI. 如果發生失敗 (硬體故障、作業系統失敗、應用程式或服務失敗) 或進行計畫的升級,資源群組擁有權就會移至 FCI 中的另一個節點。WSFC 資源群組支援的節點數目取決於 [SQL Server]SQL Server 版本。In case of a failure (hardware failures, operating system failures, application or service failures) or a planned upgrade, the resource group ownership is moved to another node in the FCI.The number of nodes that are supported in a WSFC resource group depends on your [SQL Server]SQL Server edition. 此外,相同 WSFC 叢集可以執行多個 FCI (多個資源群組),視 CPU、記憶體和磁碟數目等硬體容量而定。Also, the same WSFC cluster can run multiple FCIs (multiple resource groups), depending on your hardware capacity, such as CPUs, memory, and number of disks.

SQL Server 二進位檔SQL Server Binaries
產品二進位檔案會在 FCI 的每個節點上本機安裝,此程序類似於 [SQL Server]SQL Server 獨立安裝。The product binaries are installed locally on each node of the FCI, a process similar to [SQL Server]SQL Server stand-alone installations. 不過,在啟動期間,這些服務並不會自動啟動,而是透過 WSFC 進行管理。However, during startup, the services are not started automatically, but managed by WSFC.

儲存空間Storage
FCI 與 AlwaysOn 可用性群組相反,前者必須針對資料庫和記錄檔儲存體,在 FCI 的所有節點之間使用共用儲存體。Contrary to the Always On availability group, an FCI must use shared storage between all nodes of the FCI for database and log storage. 共用儲存體可以採用 WSFC 叢集磁碟、SAN 磁碟或 SMB 檔案共用的形式。The shared storage can be in the form of WSFC cluster disks, disks on a SAN, or file shares on an SMB. 如此一來,每當發生容錯移轉時,FCI 中的所有節點都有相同的執行個體資料檢視。This way, all nodes in the FCI have the same view of instance data whenever a failover occurs. 不過,這表示共用儲存體是潛在的單一失敗點,而 FCI 仰賴基礎儲存方案以確保資料保護。This does mean, however, that the shared storage has the potential of being the single point of failure, and FCI depends on the underlying storage solution to ensure data protection.

網路名稱Network Name
FCI 的 VNN 為 FCI 提供統一的連接點。The VNN for the FCI provides a unified connection point for the FCI. 這允許應用程式連接到 VNN,而無需知道目前使用中的節點。This allows applications to connect to the VNN without the need to know the currently active node. 當發生容錯移轉時,VNN 會在新使用中節點啟動後註冊給它。When a failover occurs, the VNN is registered to the new active node after it starts. 此程序對連接至 [SQL Server]SQL Server 的用戶端或應用程式而言是透明的,而且會將應用程式或用戶端在失敗期間遭遇停機時間的機會降到最低。This process is transparent to the client or application connecting to [SQL Server]SQL Server and this minimize the downtime the application or clients experience during a failure.

虛擬 IPVirtual IPs
在多重子網路 FCI 的情況下,FCI 中的每個子網路會被指派一個虛擬 IP 位址。In the case of a multi-subnet FCI, a virtual IP address is assigned to each subnet in the FCI. 在容錯移轉期間,DNS 伺服器上的 VNN 會更新,以指向各自子網路的虛擬 IP 位址。During a failover, the VNN on the DNS server is updated to point to the virtual IP address for the respective subnet. 在多重子網路容錯移轉後,應用程式和用戶端可以使用相同 VNN 連接到 FCI。Applications and clients can then connect to the FCI using the same VNN after a multi-subnet failover.

SQL Server 容錯移轉概念和工作SQL Server Failover Concepts and Tasks

概念和工作Concepts and Tasks 主題Topic
描述失敗偵測機制和彈性的容錯移轉原則。Describes the failure detection mechanism and the flexible failover policy. Failover Policy for Failover Cluster InstancesFailover Policy for Failover Cluster Instances
描述 FCI 管理和維護的概念。Describes concepts in FCI administration and maintenance. 容錯移轉叢集執行個體管理及維護Failover Cluster Instance Administration and Maintenance
描述多重子網路組態和概念Describes multi-subnet configuration and concepts SQL Server 多重子網路叢集 (;SQL Server);SQL Server Multi-Subnet Clustering (;SQL Server);

相關主題Related Topics

主題描述Topic descriptions 主題Topic
描述如何安裝新的 [SQL Server]SQL Server FCI。Describes how to install a new [SQL Server]SQL Server FCI. 建立新的 SQL Server 容錯移轉叢集 (;安裝程式) 」。Create a New SQL Server Failover Cluster (;Setup);
描述如何升級至 SQL Server 2014SQL Server 2014 容錯移轉叢集。Describes how to upgrade to a SQL Server 2014SQL Server 2014 failover cluster. 升級 SQL Server 容錯移轉叢集Upgrade a SQL Server Failover Cluster
描述 Windows 容錯移轉叢集概念,並提供 Windows 容錯移轉叢集相關工作的連結Describes Windows Failover Clustering Concepts and provides links to tasks related to Windows Failover Clustering Windows Server 2008Windows Server 2008:容錯移轉叢集概觀: Overview of Failover Clusters

Windows Server 2008Windows Server 2008 R2:容錯移轉叢集概觀R2: Overview of Failover Clusters
描述 FCI 節點和可用性群組複本之間的概念差異,以及使用 FCI 裝載可用性群組複本的考量。Describes the distinctions in concepts between nodes in an FCI and replicas within an availability group and considerations for using an FCI to host a replica for an availability group. 容錯移轉叢集和 Alwayson 可用性群組 (SQL Server)Failover Clustering and Always On Availability Groups (SQL Server)