升级故障转移群集实例Upgrade a failover cluster instance

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

SQL ServerSQL Server 支持将 SQL ServerSQL Server 故障转移群集升级到 SQL ServerSQL Server 的新版本、新的 SQL ServerSQL Server 服务包或积累更新,或在所有故障转移节点上分别将其安装到新的 Windows 服务包或积累更新时进行升级,故障时间限制为一次手动故障转移(或者如果无法故障转移回原始的主要副本,则限制为两次手动故障转移)。supports upgrading a SQL ServerSQL Server failover cluster to a new version of SQL ServerSQL Server, to a new SQL ServerSQL Server service pack or cumulative update, or when installing to a new Windows service pack or cumulative update separately on all failover cluster nodes, with downtime limited to a single manual failover (or two manual failovers if failing back to the original primary).

Windows Server 2012 R2Windows Server 2012 R2 之前的操作系统不支持升级包含故障转移群集实例的节点的 Windows Server 操作系统。Upgrading the Windows Server operating system of a node containing a failover cluster instance is not supported for operating systems before Windows Server 2012 R2Windows Server 2012 R2. 若要升级在 Windows Server 2012 R2Windows Server 2012 R2 或更高版本上运行的 Windows Server 故障转移群集节点,请参阅执行滚动升级或更新To upgrade a Windows Server failover cluster node running on Windows Server 2012 R2Windows Server 2012 R2 or above, see Perform a rolling upgrade or update.

支持详细信息如下所示:Support details are as follows:

  • 既支持通过用户界面进行 SQL ServerSQL Server 升级,也支持从命令提示符进行升级。SQL ServerSQL Server upgrade is supported both through the user interface and from the command prompt. 可以从每个故障转移群集节点上的命令提示符处运行升级,也可以使用 SQL ServerSQL Server 安装程序 UI 来升级每个群集节点。You can run upgrade from the command prompt on each failover cluster node, or by using the SQL ServerSQL Server setup UI to upgrade each cluster node. 有关详细信息,请参阅:For more information, see:

  • 安装新的 SQL ServerSQL Server 故障转移群集实例Install a new SQL ServerSQL Server failover cluster instance

  • 从命令提示符安装 SQL ServerInstall SQL Server from the Command Prompt

  • SQL ServerSQL Server 升级不支持以下方案:The following scenarios are not supported as part of a SQL ServerSQL Server upgrade:

    • 不能从独立的 SQL ServerSQL Server 实例升级到故障转移群集实例。You cannot upgrade from a stand-alone instance of SQL ServerSQL Server to a failover cluster instance.

    • 不能向故障转移群集实例中添加功能。You cannot add features to a failover cluster instance. 例如,不能向现在仅限 数据库引擎Database Engine 的故障转移群集实例中添加 Analysis ServicesAnalysis ServicesFor example, you cannot add the 数据库引擎Database Engine to an existing Analysis ServicesAnalysis Services-only failover cluster instance.

    • 不能将故障转移群集实例降级为 Windows Server 故障转移群集的任何节点上的独立实例。You cannot downgrade a failover cluster instance to a stand-alone instance on any node of the Windows Server failover cluster.

    • 仅允许在某些方案中更改故障转移群集实例的版本。Changing the edition of the failover cluster instance is limited to certain scenarios. 有关详细信息,请参阅 支持的版本升级For more information, see Supported Version and Edition Upgrades.

  • 在故障转移群集实例升级过程中,停机时间限制为故障转移时间和运行升级脚本所需的时间。During the failover cluster instance upgrade, downtime is limited to failover time and the time that is required for upgrade scripts to run. 在开始进行升级过程之前,如果遵循下方的故障转移群集实例滚动升级过程并满足所有节点的所有先决条件,则故障时间将最短。If you follow the failover cluster instance rolling upgrade process below and meet all prerequisites on all nodes before you begin the upgrade process, your downtime is minimal. 在内存优化表处于使用中时升级 SQL ServerSQL Server 会耗费一些额外的时间。Upgrading SQL ServerSQL Server when memory-optimized tables are in use will take some extra time. 有关详细信息,请参阅 计划并测试数据库引擎升级计划For more information, see Plan and Test the Database Engine Upgrade Plan.

先决条件Prerequisites

开始之前,请仔细阅读以下重要信息:Before you begin, review the following important information:

  • 支持的版本和版本升级:验证是否可以从你的 Windows 操作系统版本和 SQL ServerSQL Server 版本升级到 SQL Server 2019 (15.x)SQL Server 2019 (15.x)Supported Version and Edition Upgrades: Verify that you can upgrade to SQL Server 2019 (15.x)SQL Server 2019 (15.x) from your version of the Windows operating system and version of SQL ServerSQL Server. 例如,不能直接从 SQL Server 2005 故障转移群集实例升级到 SQL Server 2019 (15.x)SQL Server 2019 (15.x) 或不能升级在 Windows Server 2003Windows Server 2003 上运行的故障转移群集实例。For example, you cannot upgrade directly from a SQL Server 2005 failover clustering instance to SQL Server 2019 (15.x)SQL Server 2019 (15.x) or upgrade a failover cluster instance running on Windows Server 2003Windows Server 2003.

  • 选择数据库引擎升级方法:检查支持的版本和版本升级以及环境中安装的其他组件,并据此选择适当的升级方法和步骤,按正确顺序升级组件。Choose a Database Engine Upgrade Method: Select the appropriate upgrade method and steps based on your review of supported version and edition upgrades and also based on other components installed in your environment to upgrade components in the correct order.

  • 计划并测试数据库引擎升级计划:查看发行说明和已知升级问题、预升级清单,并制定和测试升级计划。Plan and Test the Database Engine Upgrade Plan: Review the release notes and known upgrade issues, the pre-upgrade checklist, and develop and test the upgrade plan.

  • 安装 SQL Server 的硬件和软件要求:查看安装 SQL Server 2019 (15.x)SQL Server 2019 (15.x) 的软件要求。Hardware and Software Requirements for Installing SQL Server: Review the software requirements for installing SQL Server 2019 (15.x)SQL Server 2019 (15.x). 如果需要其他软件,则应在升级过程开始之前在每个节点上安装该软件,从而最大程度减少故障时间。If additional software is required, install it on each node before you begin the upgrade process to minimize any downtime.

执行滚动升级或更新Perform a rolling upgrade or update

若要将 SQL ServerSQL Server 故障转移群集实例升级到 SQL Server 2019 (15.x)SQL Server 2019 (15.x),请使用 SQL ServerSQL Server 安装程序,从被动节点开始逐个升级加入故障转移群集实例的每个节点。To upgrade a SQL ServerSQL Server failover cluster instance to SQL Server 2019 (15.x)SQL Server 2019 (15.x), use SQL ServerSQL Server setup to upgrade each node participating in the failover cluster instance, one at a time, starting with the passive nodes. 升级每个节点时,节点被放在故障转移群集实例的可能所有者之外。As you upgrade each node, it is left out of the possible owners of the failover cluster instance. 如果发生意外故障转移,已升级的节点将不参与故障转移,直到 SQL ServerSQL Server 安装程序将 Windows Server 故障转移群集角色的所有权转移给已升级的节点。If there is an unexpected failover, the upgraded nodes do not participate in the failover until Windows Server failover cluster role ownership is moved to an upgraded node by SQL ServerSQL Server setup.

默认情况下, SQL ServerSQL Server 安装程序自动确定何时将故障转移到已升级的节点。By default, SQL ServerSQL Server setup automatically determines when to fail over to an upgraded node. 这取决于故障转移群集实例中节点的总数和已经升级的节点数。This depends on the total number of nodes in the failover cluster instance and the number of nodes that have already been upgraded. 如果有一半或更多节点已经升级,则当你在下一个节点上执行升级时, SQL ServerSQL Server 安装程序会导致故障转移到已升级的节点。When half of the nodes or more have already been upgraded, SQL ServerSQL Server setup causes a failover to an upgraded node when you perform upgrade on the next node. 在故障转移到已升级的节点后,群集组将移至已升级的节点。Upon failover to an upgraded node, the cluster group is moved to an upgraded node. 所有已升级的节点都放在可能的所有者列表中,所有尚未升级的节点都将从可能的所有者列表中删除。All the upgraded nodes are put in the possible owners list and all the nodes that are not yet upgraded are removed from the possible owners list. 升级剩余的每个节点时,节点被添加到故障转移群集实例的可能所有者那里。As you upgrade each remaining node, it is added to the possible owners of the failover cluster instance.

此过程使停机时间限制为整个故障转移群集升级过程中的一次故障转移时间和数据库升级脚本执行时间。This process results in downtime limited to one failover time and database upgrade script execution time during the whole failover cluster upgrade.

若要控制升级过程中群集节点的故障转移行为,请从命令提示符运行升级操作,并使用 /FAILOVERCLUSTERROLLOWNERSHIP 参数。To control the failover behavior of cluster nodes during the upgrade process, run the upgrade operation at the command prompt and use the /FAILOVERCLUSTERROLLOWNERSHIP parameter. 有关详细信息,请参阅 从命令提示符安装 SQL ServerFor more information, see Install SQL Server from the Command Prompt.

使用安装介质升级Upgrade with installation media

  1. 在与你要升级的版本相匹配的版本的 SQL ServerSQL Server 安装媒体中,双击根文件夹中的 setup.exe。From the SQL ServerSQL Server installation media for the edition that matches the edition you are upgrading, double-click setup.exe in the root folder. 如果之前未安装必备组件,可能会要求您安装它们。You may be asked to install the prerequisites, if they are not previously installed.

  2. 必备组件安装完成后,安装向导会启动 SQL ServerSQL Server 安装中心。After prerequisites are installed, the Installation Wizard starts the SQL ServerSQL Server Installation Center. 若要升级 SQL ServerSQL Server的现有实例,请选择你的实例。To upgrade an existing instance of SQL ServerSQL Server, select your instance.

  3. 如果需要使用 SQL ServerSQL Server 安装程序支持文件, SQL ServerSQL Server 安装程序将安装它们。If SQL ServerSQL Server setup support files are required, SQL ServerSQL Server setup installs them. 如果安装程序指示您重新启动计算机,请在继续操作之前重新启动。If you are instructed to restart your computer, restart before you continue.

  4. 系统配置检查器将在您的计算机上运行发现操作。The System Configuration Checker runs a discovery operation on your computer. 若要继续, 单击“确定”。 Click OK.To continue, 单击“确定”。 Click OK..

  5. 在“产品密钥”页上输入与旧产品版本匹配的新版本的 PID 密钥。On the Product Key page, enter the PID key for the new version edition that matches the edition of the old product version. 例如,若要升级 Enterprise 故障转移群集,必须提供 SQL Server EnterpriseSQL Server Enterprise的 PID 密钥。For example, to upgrade an Enterprise failover cluster, you must supply a PID key for SQL Server EnterpriseSQL Server Enterprise. 单击“下一步”以继续。Click Next to continue. 请注意,对于同一 SQL ServerSQL Server 实例中的所有故障转移群集节点,用于故障转移群集升级的 PID 密钥必须一致。Be aware that the PID key that you use for a failover cluster upgrade must be consistent across all failover cluster nodes in the same SQL ServerSQL Server instance.

  6. 在“许可条款”页上阅读许可协议,然后选中相应的复选框以接受许可条款和条件。On the License Terms page, read the license agreement, and then select the check box to accept the license terms and conditions. 为了帮助改进 SQL ServerSQL Server,您还可以启用功能使用情况选项并将报告发送给 MicrosoftMicrosoftTo help improve SQL ServerSQL Server, you can also enable the feature usage option and send reports to MicrosoftMicrosoft. 单击 “下一步” 继续。Click Next to continue. 若要结束安装程序,请单击 “取消”To end Setup, click Cancel.

  7. 在“选择实例”页上指定要升级到 SQL ServerSQL ServerSQL Server 2019 (15.x)SQL Server 2019 (15.x)实例。On the Select Instance page, specify the SQL ServerSQL Server instance to upgrade to SQL Server 2019 (15.x)SQL Server 2019 (15.x). 单击 “下一步” 继续。Click Next to continue.

  8. 在“功能选择”页上会预先选择要升级的功能。On the Feature Selection page, the features to upgrade are preselected. 选择功能名称后,右侧窗格中会显示每个组件组的说明。A description for each component group appears in the right pane after you select the feature name. 请注意,您不能更改要升级的功能,并且不能在升级操作过程中添加功能。Be aware that you cannot change the features to be upgraded, and you cannot add features during the upgrade operation. 若要在升级操作完成后向 SQL Server 2014 (12.x)SQL Server 2014 (12.x) 的已升级实例中添加功能,请参阅 向 SQL Server 2016 的实例添加功能(安装程序)To add features to an upgraded instance of SQL Server 2014 (12.x)SQL Server 2014 (12.x) after the upgrade operation is complete, see Add Features to an Instance of SQL Server 2016 (Setup).

    在右侧窗格中显示所选功能的必备组件。The prerequisites for the selected features are displayed on the right-hand pane. SQL Server 安装程序将在本过程后面所述的安装步骤中安装尚未安装的必备组件。SQL Server Setup will install the prerequisite that are not already installed during the installation step described later in this procedure. 为了节省时间,应在每个节点上预安装这些必备组件。To save time, you should pre-install these prerequisites on each node.

  9. 在“实例配置”页上,那些字段自动从旧实例进行填充。On the Instance Configuration page, fields are automatically populated from the old instance. 您可以选择指定新的 InstanceID 值。You can choose to specify the new InstanceID value.

    实例 ID - 默认情况下,实例名称用作实例 ID。Instance ID - By default, the instance name is used as the Instance ID. 这用于标识 SQL ServerSQL Server实例的安装目录和注册表项。This is used to identify installation directories and registry keys for your instance of SQL ServerSQL Server. 默认实例和命名实例都是如此。This is the case for default instances and named instances. 对于默认实例,实例名称和实例 ID 为 MSSQLSERVER。For a default instance, the instance name and instance ID would be MSSQLSERVER. 若要使用非默认的实例 ID,请选中 “实例 ID” 复选框,并提供一个值。To use a nondefault instance ID, select the Instance ID check box and provide a value. 如果覆盖默认值,则必须为所有故障转移群集节点上要升级的实例指定相同的实例 ID。If you override the default value, you must specify the same Instance ID for the instance being upgraded on all the failover cluster nodes. 已升级的实例的实例 ID 必须在所有节点上匹配。The Instance ID for the upgraded instance must match across the nodes.

    检测到的实例和功能 - 该网格显示运行安装程序的计算机上的 SQL ServerSQL Server 实例。Detected instances and features - The grid shows instances of SQL ServerSQL Server that are on the computer where setup is running. 单击 “下一步” 继续。Click Next to continue.

  10. “磁盘空间要求”页计算指定的功能所需的磁盘空间,并将磁盘空间要求与正在运行安装程序的计算机上的可用磁盘空间进行比较。The Disk Space Requirements page calculates the required disk space for the features that you specify, and compares requirements to the available disk space on the computer where Setup is running.

  11. 在“全文搜索升级”页上为所升级的数据库指定升级选项。On the Full-Text Search Upgrade page, specify the upgrade options for the databases being upgraded. 有关详细信息,请参阅 全文搜索升级选项For more information, see Full-Text Search Upgrade Options.

  12. “错误报告” 页上,指定要发送到 MicrosoftMicrosoft 以帮助改进 SQL ServerSQL Server的信息。On the Error Reporting page, specify the information that you want to send to MicrosoftMicrosoft that will help improve SQL ServerSQL Server. 默认情况下,将启用用于错误报告的选项。By default, options for error reporting is enabled.

  13. 在升级操作开始之前,系统配置检查器将运行多组规则来针对您指定的 SQL ServerSQL Server 功能验证您的计算机配置。The System Configuration Checker runs one more set of rules to validate your computer configuration with the SQL ServerSQL Server features that you have specified, before the upgrade operation begins.

  14. “群集升级报告”页显示故障转移群集实例中的节点列表和每个节点上的 SQL ServerSQL Server 组件的实例版本信息。The Cluster Upgrade Report page displays the list of nodes in the failover cluster instance and the instance version information for SQL ServerSQL Server components on each node. 它显示数据库脚本状态和复制脚本状态。It displays the database script status and replication script status. 此外,还会显示有关单击 “下一步” 时会发生的情况的信息性消息。In addition, it also displays informational messages on what will occur when you click Next. 根据已升级的故障转移群集节点数和节点总数,安装程序会显示你单击“下一步” 时发生的故障转移行为。Depending on the number of failover cluster nodes that have already been upgraded and total number of nodes, setup displays the failover behavior that happens when you click Next. 如果您尚未安装必备组件,还会就潜在的不必要停机时间向您发出警告。It also warns about potential unnecessary downtime if you have not installed the prerequisites already.

  15. “准备升级”页显示您在安装过程中指定的安装选项的树视图。The Ready to Upgrade page displays a tree view of installation options that were specified during Setup. 若要继续,请单击 “升级”To continue, click Upgrade. SQL ServerSQL Server 安装程序将首先安装所选功能的必备组件,然后安装所选功能。Setup will first install the required prerequisites for the selected features followed by the feature installation.

  16. 在升级过程中,“进度”页会提供相应的状态,因此您可以在安装程序进行的过程中监视当前节点上的升级进度。During upgrade, the Progress page provides status so that you can monitor the upgrade progress on the current node as Setup continues.

  17. 完成当前节点的升级后,“群集升级报告”页将显示所有故障转移群集节点的升级状态信息、每个故障转移群集节点上的功能及其版本信息。After the upgrade of the current node, the Cluster Upgrade Report page displays an upgrade status information for all the failover cluster nodes, features on each failover cluster node, and their version information. 确认显示的版本信息正确,然后继续对剩余节点进行升级。Confirm the version information that is displayed and continue with the upgrade of the remaining nodes. 如果发生了向已升级的节点进行的故障转移,则也会显示在状态页上。If the failover to upgraded nodes occurred, this is also apparent on the status page. 您还可以登入 Windows 群集管理员工具以进行确认。You can also check in the Windows Cluster administrator tool to confirm.

  18. 升级完成后,“完成”页会提供指向安装摘要日志文件以及其他重要说明的链接。After upgrade, the Complete page provides a link to the summary log file for the installation and other important notes. 若要完成 SQL ServerSQL Server 安装过程,请单击 “关闭”To complete the SQL ServerSQL Server installation process, click Close.

  19. 如果安装程序指示您重新启动计算机,请立即重新启动。If you are instructed to restart the computer, do so now. 安装完成后,请务必阅读来自安装向导的消息。It is important to read the message from the Installation Wizard when you have finished with Setup. 有关安装程序日志文件的详细信息,请参阅 查看和阅读 SQL Server 安装程序日志文件For more information about Setup log files, see View and Read SQL Server Setup Log Files.

  20. 若要完成升级过程,请在 SQL ServerSQL Server 故障转移群集实例的所有其他节点上重复这些步骤。To complete the upgrade process, repeat these steps on all the other nodes of the SQL ServerSQL Server failover cluster instance.

升级多子网故障转移群集实例Upgrade a multi-subnet failover cluster instance

按照以下步骤在多子网环境中升级 Always On 故障转移群集实例。Follow these steps to upgrade your Always On failover cluster instance in a multi-subnet environment.

升级到 SQL ServerSQL Server 多子网故障转移群集实例(现有 SQL ServerSQL Server 群集是非多子网群集)。To upgrade to a SQL ServerSQL Server multi-subnet failover cluster instance (Existing SQL ServerSQL Server cluster is a non multi-subnet cluster).

  1. 按照上述步骤升级故障转移群集实例。Follow the steps above to upgrade your failover cluster instance.

  2. 使用 AddNode 安装程序操作添加不同子网上的节点,并确认在“群集网络配置”页将 IP 地址资源依赖关系更改为 OR。To add a new node on a different subnet using the AddNode Setup action and confirm the IP address resource dependency to OR on the Cluster Network Configuration page. 有关详细信息,请参阅在 Always On 故障转移群集实例中添加或删除节点(安装程序)For more information, see Add or Remove Nodes in an Always On failover cluster instance (Setup).

将当前使用 Stretch VLAN 的多子网故障转移群集实例升级为使用多子网。To upgrade a multi-subnet failover cluster instance currently using Stretch VLAN to use multi-subnet.

  1. 按照上述步骤将群集升级到 SQL Server 2019 (15.x)SQL Server 2019 (15.x)Follow the steps above to upgrade your cluster to SQL Server 2019 (15.x)SQL Server 2019 (15.x).

  2. 更改网络设置以将远程节点移到不同的子网。Change the network settings to move the remote node to a different subnet.

  3. 使用故障转移群集管理器或 PowerShell 添加新子网的新 IP 地址,将 IP 地址资源依赖关系设置为 OR。Using Failover Cluster Manager or PowerShell, add a new IP address for the new subnet to set the IP address resource dependency to OR.

后续步骤Next Steps

升级到 SQL Server 2019 (15.x)SQL Server 2019 (15.x)后,请完成下列任务:After you upgrade to SQL Server 2019 (15.x)SQL Server 2019 (15.x), complete the following tasks: