gpt4 book ai didi

sql-server - AlwaysOn AG 不会在 SQL Server Windows 服务重新启动时进行故障转移

转载 作者:行者123 更新时间:2023-12-05 07:59:05 25 4
gpt4 key购买 nike

我正在尝试测试我的应用程序数据库的 SQL Server AlwaysOn 可用性组行为。我已经创建了可用性组并且能够从集群管理器或从 SQL Server Studio 正确地模拟故障转移。如果服务器事件节点重新启动,也会发生故障转移。

作为最后的测试,我在事件节点上重新启动了 SQL Server 的 Windows 服务。我原以为 AG 会在服务停止后立即故障转移到辅助节点,但事实并非如此。主节点经历了服务重启。

当服务暂时停止时,没有节点切换。这是否意味着仅当服务停机达到某个阈值时才会发生故障转移?如果是这样,这个阈值是多少?

最佳答案

回复旧线程,以便阅读它的任何人都能受益。

Does that mean that failover will happen only if the service was down for some threshold? if so, what is that threshold?

不,事实并非如此。简单地说,WSFC 没有启动故障转移,因为参数 Failure-Condition Level 是默认值 3。并且根据 Microsoft 官方文档 Configure a flexible automatic failover policy for an Always On availability group要使 SQL Server 重新启动以触发故障转移,您需要 Failure-Condition Level=1

您可以使用 Powershell 或集群 GUI 或 TSQL 更改该值。参见 Configure FailureConditionLevel property settings

例如:

The following example changes the FailureConditionLevel setting on the SQL Server resource "SQL Server (INST1)" to fail over or restart on critical server errors.

Import-Module FailoverClusters  

$fci = "SQL Server (INST1)"
Get-ClusterResource $fci | Set-ClusterParameter FailureConditionLevel 3

关于sql-server - AlwaysOn AG 不会在 SQL Server Windows 服务重新启动时进行故障转移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23086003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com