Azure 虚拟机上的 SQL Server 故障转移群集实例 (FCI)Failover cluster instances with SQL Server on Azure Virtual Machines

适用于: Azure VM 上的 SQL Server

本文介绍了在 Azure 虚拟机 (VM) 上使用 SQL Server 故障转移群集实例 (FCI) 时的功能差异。This article introduces feature differences when you're working with failover cluster instances (FCI) for SQL Server on Azure Virtual Machines (VMs).

概述Overview

Azure VM 上的 SQL Server 使用 Windows Server 故障转移群集 (WSFC) 功能通过冗余在服务器实例级别(故障转移群集实例)上提供本地高可用性。SQL Server on Azure VMs uses Windows Server Failover Clustering (WSFC) functionality to provide local high availability through redundancy at the server-instance level: a failover cluster instance. FCI 是跨 WSFC(或只是群集)节点和(可能)跨多个子网安装的 SQL Server 的单个实例。An FCI is a single instance of SQL Server that's installed across WSFC (or simply the cluster) nodes and, possibly, across multiple subnets. 在网络上,FCI 显示为在单台计算机上运行的 SQL Server 的一个实例。On the network, an FCI appears to be an instance of SQL Server running on a single computer. 但是,如果当前节点变得不可用,则 FCI 提供从一个 WSFC 节点到另一个 WSFC 节点的故障转移。But the FCI provides failover from one WSFC node to another if the current node becomes unavailable.

本文的其余部分重点介绍在将故障转移群集实例与 Azure VM 上的 SQL Server 一起使用时这些实例的区别。The rest of the article focuses on the differences for failover cluster instances when they're used with SQL Server on Azure VMs. 若要详细了解故障转移群集技术,请参阅:To learn more about the failover clustering technology, see:

QuorumQuorum

Azure 虚拟机上的 SQL Server 故障转移群集实例支持对群集仲裁使用磁盘见证、云见证或文件共享见证。Failover cluster instances with SQL Server on Azure Virtual Machines support using a disk witness, a cloud witness, or a file share witness for cluster quorum.

若要了解详细信息,请参阅 Azure 中 SQL Server VM 的仲裁最佳做法To learn more, see Quorum best practices with SQL Server VMs in Azure.

存储Storage

在传统本地群集环境中,Windows 故障转移群集将可供两个节点访问的存储区域网络 (SAN) 用作共享存储。In traditional on-premises clustered environments, a Windows failover cluster uses a storage area network (SAN) that's accessible by both nodes as the shared storage. SQL Server 文件托管在共享存储上,且只有活动节点可同时访问这些文件。SQL Server files are hosted on the shared storage, and only the active node can access the files at one time.

Azure VM 上的 SQL Server 提供各种选项用作共享存储解决方案,它适用于 SQL Server 故障转移群集实例的部署:SQL Server on Azure VMs offers various options as a shared storage solution for a deployment of SQL Server failover cluster instances:

Azure 共享磁盘Azure shared disks 高级文件共享Premium file shares 存储空间直通 (S2D)Storage Spaces Direct (S2D)
最低操作系统版本Minimum OS version AllAll Windows Server 2012Windows Server 2012 Windows Server 2016Windows Server 2016
最低 SQL Server 版本Minimum SQL Server version AllAll SQL Server 2012SQL Server 2012 SQL Server 2016SQL Server 2016
受支持的 VM 可用性Supported VM availability 具有邻近放置组的可用组集Availability sets with proximity placement groups 可用性集Availability sets 可用性集Availability sets
支持文件流Supports FileStream Yes No Yes
Azure Blob 缓存Azure blob cache No No Yes

此部分的其余内容列出了可用于 Azure VM 上的 SQL Server 的每个存储选项的优点和限制。The rest of this section lists the benefits and limitations of each storage option available for SQL Server on Azure VMs.

Azure 共享磁盘Azure shared disks

Azure 共享磁盘Azure 托管磁盘的一项功能。Azure shared disks are a feature of Azure managed disks. Windows Server 故障转移群集支持将 Azure 共享磁盘与故障转移群集实例一起使用。Windows Server Failover Clustering supports using Azure shared disks with a failover cluster instance.

支持的操作系统:AllSupported OS: All
支持的 SQL 版本:AllSupported SQL version: All

优点:Benefits:

  • 适用于希望迁移到 Azure,同时保持其高可用性和灾难恢复 (HADR) 体系结构不变的应用程序。Useful for applications looking to migrate to Azure while keeping their high-availability and disaster recovery (HADR) architecture as is.
  • 得益于 SCSI 持久性预留 (SCSI PR) 支持,可按原样将群集应用程序迁移到 Azure。Can migrate clustered applications to Azure as is because of SCSI Persistent Reservations (SCSI PR) support.
  • 支持共享的 Azure 高级 SSD 和 Azure 超级磁盘存储。Supports shared Azure Premium SSD and Azure Ultra Disk storage.
  • 可使用单个共享磁盘或对多个共享磁盘设置带区来创建共享存储池。Can use a single shared disk or stripe multiple shared disks to create a shared storage pool.
  • 支持文件流。Supports Filestream.

限制Limitations:

  • 建议将虚拟机放置在同一可用性集和邻近放置组中。It is recommended to place the virtual machines in the same availability set and proximity placement group.
  • 无论选择哪种硬件可用性解决方案,在使用 Azure 共享磁盘时,故障转移群集的可用性始终为 99.9%。Regardless of the chosen hardware availability solution, the availability of the failover cluster is always 99.9% when using Azure Shared Disks.
  • 不支持高级 SSD 磁盘缓存。Premium SSD disk caching is not supported.

首先,请参阅 SQL Server 故障转移群集实例与 Azure 共享磁盘To get started, see SQL Server failover cluster instance with Azure shared disks.

存储空间直通Storage Spaces Direct

存储空间直通是一项 Windows Server 功能,可用于 Azure 虚拟机上的故障转移群集。Storage Spaces Direct is a Windows Server feature that is supported with failover clustering on Azure Virtual Machines. 它提供基于软件的虚拟 SAN。It provides a software-based virtual SAN.

支持的操作系统:Windows Server 2016 及更高版本Supported OS: Windows Server 2016 and later
支持的 SQL 版本:SQL Server 2016 及更高版本Supported SQL version: SQL Server 2016 and later

优点:Benefits:

  • 充足的网络带宽可实现可靠且性能高的共享存储解决方案。Sufficient network bandwidth enables a robust and highly performant shared storage solution.
  • 支持 Azure Blob 缓存,因此可从缓存中本地提供读取。Supports Azure blob cache, so reads can be served locally from the cache. (更新同步复制到两个节点。)(Updates are replicated simultaneously to both nodes.)
  • 支持文件流。Supports FileStream.

限制:Limitations:

  • 仅适用于 Windows Server 2016 及更高版本。Available only for Windows Server 2016 and later.
  • 要求对两个虚拟机附加相同的磁盘容量。Requires the same disk capacity attached to both virtual machines.
  • 由于仍在进行的磁盘复制,需要高网络带宽来实现高性能。High network bandwidth is required to achieve high performance because of ongoing disk replication.
  • 由于对每个 VM 附加了存储,因此需要更大的 VM 大小且存储费用加倍。Requires a larger VM size and double pay for storage, because storage is attached to each VM.

首先,请参阅 SQL Server 故障转移群集实例与存储空间直通To get started, see SQL Server failover cluster instance with Storage Spaces Direct.

高级文件共享Premium file share

高级文件共享Azure 文件存储的一项功能。Premium file shares are a feature of Azure Files. 高级文件共享由 SSD 提供支持,始终具有低延迟。Premium file shares are SSD backed and have consistently low latency. 它们完全支持在 Windows Server 2012 或更高版本上用于 SQL Server 2012 或更高版本的故障转移群集实例。They're fully supported for use with failover cluster instances for SQL Server 2012 or later on Windows Server 2012 or later. 高级文件共享提供更高的灵活性,使你能在不停机的情况下对文件共享进行大小调整和缩放。Premium file shares give you greater flexibility, because you can resize and scale a file share without any downtime.

支持的操作系统:Windows Server 2012 和更高版本Supported OS: Windows Server 2012 and later
支持的 SQL 版本:SQL Server 2012 和更高版本Supported SQL version: SQL Server 2012 and later

优点:Benefits:

  • 完全托管的文件系统,具有单位数的延迟和可突发的 I/O 性能。Fully managed file system with single-digit latencies and burstable I/O performance.

限制:Limitations:

  • 仅适用于 Windows Server 2012 及更高版本。Available only for Windows Server 2012 and later.
  • 不支持文件流。FileStream is not supported.

首先,请参阅 SQL Server 故障转移群集实例与高级文件共享To get started, see SQL Server failover cluster instance with Premium file share.

PartnerPartner

有一些合作伙伴群集解决方案采用受支持的存储。There are partner clustering solutions with supported storage.

支持的操作系统:AllSupported OS: All
支持的 SQL 版本:AllSupported SQL version: All

一个示例是将 SIOS DataKeeper 用作存储。One example uses SIOS DataKeeper as the storage. 有关详细信息,请参阅故障转移群集和 SIOS DataKeeper 博客文章。For more information, see the blog entry Failover clustering and SIOS DataKeeper.

iSCSI 和 ExpressRouteiSCSI and ExpressRoute

还可通过 Azure ExpressRoute 公开 iSCSI 目标共享块存储。You can also expose an iSCSI target shared block storage via Azure ExpressRoute.

支持的操作系统:AllSupported OS: All
支持的 SQL 版本:AllSupported SQL version: All

例如,NetApp 专用存储 (NPS) 使用 Equinix 通过 ExpressRoute 向 Azuer VM 公开 iSCSI 目标。For example, NetApp Private Storage (NPS) exposes an iSCSI target via ExpressRoute with Equinix to Azure VMs.

对于 Azure 合作伙伴提供的共享存储和数据复制解决方案,如有任何关于在故障转移时访问数据的问题,请联系供应商。For shared storage and data replication solutions from Azure partners, contact the vendor for any issues related to accessing data on failover.

连接Connectivity

Azure 虚拟机上的 SQL Server 故障转移群集实例使用分布式网络名称 (DNN)Azure 负载均衡器虚拟网络名称 (VNN) 将流量路由到 SQL Server 实例,而不管哪个节点当前拥有群集资源。Failover cluster instances with SQL Server on Azure Virtual Machines use a distributed network name (DNN) or a virtual network name (VNN) with Azure Load Balancer to route traffic to the SQL Server instance, regardless of which node currently owns the clustered resources. 在将某些功能和 DNN 与 SQL Server FCI 一起使用时,还有其他注意事项。There are additional considerations when using certain features and the DNN with a SQL Server FCI. 有关详细信息,请参阅 DNN 互操作性与 SQL Server FCISee DNN interoperability with SQL Server FCI to learn more.

有关群集连接选项的更多详细信息,请参阅将 HADR 连接路由到 Azure VM 上的 SQL ServerFor more details about cluster connectivity options, see Route HADR connections to SQL Server on Azure VMs.

限制Limitations

使用 Azure 虚拟机上的 SQL Server 故障转移群集实例时,请考虑以下限制。Consider the following limitations for failover cluster instances with SQL Server on Azure Virtual Machines.

MSDTCMSDTC

Azure 虚拟机支持 Windows Server 2019 上的 Microsoft 分布式事务处理协调器 (MSDTC),其中存储位于群集共享卷 (CSV) 和标准负载均衡器上,或者位于正在使用 Azure 共享磁盘的 SQL Server VM 上。Azure Virtual Machines support Microsoft Distributed Transaction Coordinator (MSDTC) on Windows Server 2019 with storage on Clustered Shared Volumes (CSV) and Azure Standard Load Balancer or on SQL Server VMs that are using Azure shared disks.

在 Azure 虚拟机上,具有群集共享卷的 Windows Server 2016 或更早版本不支持 MSDTC,因为:On Azure Virtual Machines, MSDTC isn't supported for Windows Server 2016 or earlier with Clustered Shared Volumes because:

  • 无法将群集 MSDTC 资源配置为使用共享存储。The clustered MSDTC resource can't be configured to use shared storage. 在 Windows Server 2016 上,如果创建 MSDTC 资源,即使存储可用,它也不会显示任何可用的共享存储。On Windows Server 2016, if you create an MSDTC resource, it won't show any shared storage available for use, even if storage is available. Windows Server 2019 中已修复此问题。This issue has been fixed in Windows Server 2019.
  • 基本负载均衡器不处理 RPC 端口。The basic load balancer doesn't handle RPC ports.

后续步骤Next steps

查看群集配置最佳做法Review cluster configurations best practices.

有关详细信息,请参阅:For more information, see: