無法將 SQL Server Always On 可用性組偵聽器添加到第二個子網
我在兩個 2016 節點 - DB1 和 DB2 之間有一個 WSFC 集群。
(集群網路 1 和 3 設置為不承載集群流量。)
故障轉移集群管理器顯示集群網路 2 有兩個子網:
10.70.119.192/26
10.68.79.240/28
節點 DB1 位於此處,並且在以下視窗中具有 IP 地址:10.70.119.212
10.68.79.254
故障轉移集群管理器顯示集群網路 4 有兩個子網:
10.136.98.0/26
10.137.72.224/28
節點 DB2 在這裡,並且在以下視窗中具有 IP 地址:10.136.98.40
10.137.72.238
作為參考,我之前設置了一個可用性組偵聽器 (AG2) 就好了。它使用以下靜態 IP:10.136.98.15
10.70.119.214
AG2一切正常。
現在,我想在另一個子網上設置 AG1。
採用
$$ master $$ 去
更改可用性組
$$ AG1 $$ 添加監聽器 N’ag111’ (
有智慧財產權
((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。
但怎麼可能呢?Cluster Manager 清楚地將網路 10.137.72.224/28 顯示為網路上的有效子網。為什麼它認為IP無效?
(嘗試使用在 Windows 中註冊的實際 IP 會產生相同的結果。AG2 也不使用已註冊的 IP)。
如果我嘗試直接在 WSFC 中添加“客戶端訪問點”,而不是 SSMS 嚮導,它不允許我從我在這裡嘗試使用的子網中輸入靜態 IP 地址。只顯示第一個子網(上面有 AG2)。
非常感謝
很確定這是 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'