无法将 SQL Server Always On 可用性组侦听器添加到第二个子网

无法将 SQL Server Always On 可用性组侦听器添加到第二个子网

我在两个 2016 节点(DB1 和 DB2)之间有一个 WSFC 集群。

(集群网络 1 和 3 设置为不承载集群流量。)

故障转移群集管理器显示群集网络 2 有两个子网:

10.70.119.192/26

10.68.79.240/28

节点 DB1 在此处,在 Windows 中的 IP 地址为:10.70.119.212

10.68.79.254

故障转移群集管理器显示群集网络 4 有两个子网:

10.136.98.0/26

10.137.72.224/28

节点 DB2 在此处,在 Windows 中的 IP 地址为:10.136.98.40

10.137.72.238

作为参考,我之前已经成功设置了一个可用性组侦听器 (AG2)。它使用静态 IP:10.136.98.15

10.70.119.214

AG2 一切顺利。

现在,我想在另一个子网上设置 AG1。

使用[主]

修改可用性组 [AG1]

添加听众 N'ag111' (

带 IP

((N'10.137.72.228',N'255.255.255.240'),

(N'10.68.79.242',N'255.255.255.240')

,端口=1433);

(以上内容由向导生成。向导允许我从下拉列表中选择子网 - 因此很明显 SQL 知道这些子网。)

运行失败,显示:

Msg 41009, Level 16, State 7, Line 3
The Windows Server Failover Clustering (WSFC) resource control API returned error code 5894.  If this is a WSFC availability group, the WSFC service may not be running or may not be accessible in its current state, or the specified arguments are invalid.  Otherwise, contact your primary support provider.  For information about this error code, see "System Error Codes" in the Windows Development documentation.
Msg 19476, Level 16, State 3, Line 3
The attempt to create the network name and IP address for the listener failed. If this is a WSFC availability group, the WSFC service may not be running or may be inaccessible in its current state, or the values provided for the network name and IP address may be incorrect. Check the state of the WSFC cluster and validate the network name and IP address with the network administrator. Otherwise, contact your primary support provider.
Msg 19476, Level 16, State 1, Line 3
The attempt to create the network name and IP address for the listener failed. If this is a WSFC availability group, the WSFC service may not be running or may be inaccessible in its current state, or the values provided for the network name and IP address may be incorrect. Check the state of the WSFC cluster and validate the network name and IP address with the network administrator. Otherwise, contact your primary support provider.

我在集群日志中看到的内容是这样的:

00000c68.00001c34::2019/05/04-19:55:01.196 INFO  [RCM] rcm::RcmApi::CreateResource: (AG1, AG1_10.137.72.228, 7b048e90-89fc-4755-9ddf-19778818fc86, IP Address)
00000c68.00001c34::2019/05/04-19:55:01.196 INFO  [GUM] Node 2: executing request locally, gumId:1593, my action: /rcm/gum/CreateResource, # of updates: 1
00000c68.00001c34::2019/05/04-19:55:01.196 INFO  [RCM] rcm::RcmGum::CreateResource(AG1_10.137.72.228,7b048e90-89fc-4755-9ddf-19778818fc86,AG1)
00001c24.00002408::2019/05/04-19:55:01.197 INFO  [RHS] Registering HDL( 2089aead170 ) as a valid RHS resource handle
00001c24.00002408::2019/05/04-19:55:01.197 INFO  [RHS] OpenResource: opening resource AG1_10.137.72.228 of type IP Address with handle HDL( 2089aead170 )
00001c24.000003f0::2019/05/04-19:55:01.201 INFO  [RES] IP Address <AG1_10.137.72.228>: Unable to open node parameters key, status 2.
00001c24.000003f0::2019/05/04-19:55:01.201 INFO  [RES] IP Address <AG1_10.137.72.228>: Resource open, resource ID = 2590498176.
00000c68.00001488::2019/05/04-19:55:01.201 INFO  [RCM] HandleMonitorReply: OPENRESOURCE for 'AG1_10.137.72.228', gen(0) result 0/0.
00000c68.00001c34::2019/05/04-19:55:01.204 INFO  [GUM] Node 2: executing request locally, gumId:1594, my action: /dm/update, # of updates: 1
00001c24.00002408::2019/05/04-19:55:01.210 INFO  [RES] IP Address <AG1_10.137.72.228>: IpaValidatePrivateResProperties: attempting to change property Address to from 0.0.0.0 to 10.137.72.228.
00001c24.00002408::2019/05/04-19:55:01.210 INFO  [RES] IP Address <AG1_10.137.72.228>: IpaValidatePrivateResProperties: attempting to change property SubnetMask from 0.0.0.0 to 255.255.255.240.
00001c24.00002408::2019/05/04-19:55:01.214 ERR   [RES] IP Address <AG1_10.137.72.228>: IpaValidatePrivateResProperties: failed to find cluster network matching address 10.137.72.228 and subnet mask 255.255.255.240. Error: 259.
00001c24.00002408::2019/05/04-19:55:01.214 ERR   [RHS] Error 5894 from ResourceControl 20971654 for resource AG1_10.137.72.228.
00000c68.00001488::2019/05/04-19:55:01.215 INFO  [RCM] rcm::RcmApi::DeleteResource: (AG1_10.137.72.228, force=false)
00001c24.00002408::2019/05/04-19:55:01.215 ERR   [RES] IP Address <AG1_10.137.72.228>: IpaRetrieveLeaseDetails: Unable to read the 'Network' property. Error: 13.
00001c24.00002408::2019/05/04-19:55:01.215 ERR   [RES] IP Address <AG1_10.137.72.228>: IpaReleaseLeaseWhileOffline: IpaRetrieveLeaseDetails failed, 13.
00001c24.00002408::2019/05/04-19:55:01.215 INFO  [RES] IP Address <AG1_10.137.72.228>: IpaResourceControl, DELETE: IpaReleaseLeaseWhileOffline failed status 13.
00001c24.00002408::2019/05/04-19:55:01.215 ERR   [RHS] Error 13 from ResourceControl 22020102 for resource AG1_10.137.72.228.
00000c68.00001488::2019/05/04-19:55:01.215 INFO  [RCM] Letting all nodes complete any pending resource controls for resource AG1_10.137.72.228
00000c68.00001488::2019/05/04-19:55:01.218 INFO  [GUM] Node 2: executing request locally, gumId:1595, my action: /rcm/gum/DeleteResource, # of updates: 1
00000c68.00001488::2019/05/04-19:55:01.218 INFO  [RCM] rcm::RcmGum::DeleteResource(AG1_10.137.72.228)
00001c24.00002408::2019/05/04-19:55:01.218 INFO  [RHS] Closing resource with handle HDL( 2089aead170 )
00001c24.00002408::2019/05/04-19:55:01.218 INFO  [RHS] Close for resource with handle HDL( 2089aead170 ) has completed, releasing memory
00001c24.000003f0::2019/05/04-19:55:01.219 INFO  [RES] IP Address <AG1_10.137.72.228>: IpaClose entry
00001c24.000003f0::2019/05/04-19:55:01.219 INFO  [RES] IP Address <AG1_10.137.72.228>: IpaReleaseResource entry
00001c24.000003f0::2019/05/04-19:55:01.219 INFO  [RES] IP Address <AG1_10.137.72.228>: Resource closed.
00001c24.000003f0::2019/05/04-19:55:01.219 INFO  [RHS] Removing handle HDL( 2089aead170 ) from valid RHS resource handles
00000c68.00001488::2019/05/04-19:55:01.223 INFO  [GUM] Node 2: executing request locally, gumId:1596, my action: /dm/update, # of updates: 1

因此错误似乎很清楚 - 不是权限等,但是:

IpaValidatePrivateResProperties:无法找到与地址 10.137.72.228 和子网掩码 255.255.255.240 匹配的群集网络。错误:259。

但怎么会这样呢?集群管理器清楚地显示网络 10.137.72.224/28 是网络上的有效子网。为什么它认为 IP 无效?

(尝试使用在 Windows 中注册的实际 IP 会产生相同的结果。AG2 也不使用已注册的 IP)。

如果我尝试直接在 WSFC 中添加“客户端访问点”,而不是使用 SSMS 向导,它会不是允许我输入我尝试在此处使用的子网中的静态 IP 地址。仅显示第一个子网(其中包含 AG2)。

非常感谢

答案1

很确定这是 WSFC / SSMS UI 中的一个错误。

使用 powershell,我手动添加了 IP 地址和网络名称,并将它们与依赖关系绑定在一起,一切就都正常了。

一些脚本可以帮助任何有类似需求的人:


Add-ClusterResource -Name "IPAddress1" -ResourceType "IP Address" -Group "AG1" 
Get-ClusterResource -Name IPAddress1 | Set-ClusterParameter -Multiple @{"Network" = "NET_PRIV_DB2";"Address" = "10.137.72.228";"SubnetMask" = "255.255.255.240";"EnableDHCP" = 0} 

Add-ClusterResource -Name "IPAddress2" -ResourceType "IP Address" -Group "AG1" 
Get-ClusterResource -Name IPAddress2 | Set-ClusterParameter -Multiple @{"Network" = "NET_PRIV_DB1";"Address" = "10.68.79.242";"SubnetMask" = "255.255.255.240";"EnableDHCP" = 0} 


Add-ClusterResource -Name "ag1_sql_ag" -Group "AG1" -ResourceType "Network Name" 
Get-ClusterResource -Name "ag1_sql_ag" | Set-ClusterParameter -Multiple @{"DnsName" = "ag1_sql_ag";"RegisterAllProvidersIP" = 1} 

Set-ClusterResourceDependency -Resource ag1_sql_ag -Dependency "[IPAddress1] or [IPAddress2]" 
Start-ClusterResource -Name ag1_sql_ag -Verbose 



Add-ClusterResourceDependency -Resource 'AG1' -Provider 'ag1_sql_ag'

相关内容