對 容錯移轉叢集 執行錯誤排除時,將需要分析 Windows cluster log (Cluster.log)。
可以使用 PowerShell 的 Get-ClusterLog 來產生 全部 或是 指定 節點伺服器的系統記錄檔。
本文以 [SQL Server] AlwaysOn, Error 41131, failover failed,容錯移轉 失敗 為例
逐步帶領各位使用 PowerShell 的 Get-ClusterLog 來產生 Cluster.log,執行 錯誤排除 [NT AUTHORITY\SYSTEM] 帳戶權限不足 的問題。
目的:產生 Failover Cluster log
作業系統:Windows 2008 R2/2012/2012 R2/2016 Cluster
請使用 「系統管理員身分」來啟動 「Windows PowerShell ISE」
提醒:請到各個 Node Server 去檢視 log。
-- 為每個 Node Server 產生 Failover Cluster log, -- 並存放於預設的本機路徑:C:\Windows\Cluster\Reports -- -UseLocalTime:採用 LocalTime,若未指定此參數,將使用 Greenwich Mean Time (GMT)。 Get-ClusterLog -Destination . -UseLocalTime-- 010_執行Get-ClusterLog

-- 011_檢視產生的 Failover_Cluster_log

[PowerShell] Get-ClusterLog: Generate Windows cluster log for troubleshooting
工作01. 使用 [PowerShell] Get-ClusterLog: 產生 Windows cluster log
-- 語法 Get-ClusterLog –Node [SQL Server node name] –TimeSpan 15
-- 範例 Get-ClusterLog –Node AGN02 –TimeSpan 15
-TimeSpan |
指定要產生 Cluster.log 的時間間距,以分鐘為單位。
例如:–TimeSpan 15,是指產生最近 15 分鐘內的 Cluster.log。
|
- Node | 指定需要產生 Cluster.log 節點伺服器。 |
-UseLocalTime | 採用 LocalTime,若未指定此參數,將使用 Greenwich Mean Time (GMT) |
Cluster.log |
系統紀錄 Cluster.log 預設是存放在 %WINDIR%\cluster\reports。
例如:C:\Windows\Cluster\Reports。
|
-- 01_01_PowerShell 產生 Windows cluster log

工作02. 分析 Windows cluster log(Cluster.log)
分析 Cluster.log
搜尋以下文字:
Failed to run diagnostics command.
The user does not have permission to perform this action.
-- 02_檢視Cluster_Log

-- 03_查詢到相關聯的錯誤_The user does not have permission to perform this action.

分析
在 Cluster.log 報告中,可以看到系統紀錄了 權限不足 的問題。
這是因為 [NT AUTHORITY\SYSTEM] 帳戶的權限不足,無法執行 「健全狀況」的偵測,也無法執行 「容錯移轉(Failover) 」。
解決方案
賦予 [NT AUTHORITY\SYSTEM] 帳戶以下權限來解決問題:
- Alter Any Availability Group
- Connect SQL
- View server state
參考
補充資訊
-- 10_Error_41131

-- 30_SQL_Log

-- 31_發出Failover

-- 32_Error_Reported_02_TO_01

-- 33_RESOLVING_PENDING_FAILOVER

-- 34_state_change

-- 35_Rollback_Failover

-- 36_state_change__SECONDARY_NORMAL

-- 50_SQL_Log

-- 51_發出 Failover

參考文件
[SQL Server] AlwaysOn, Error 41131, failover failed,容錯移轉 失敗
http://sharedderrick.blogspot.tw/2017/07/sql-server-alwayson-error-41131.html
Cannot create a high-availability group in Microsoft SQL Server 2012
https://support.microsoft.com/en-us/help/2847723/cannot-create-a-high-availability-group-in-microsoft-sql-server-2012
Windows Server 2008 R2: Troubleshooting Failover Clusters
https://technet.microsoft.com/en-us/library/hh272674.aspx
Microsoft.FailoverClusters.PowerShell
https://technet.microsoft.com/en-us/library/ee461009.aspx
Get-ClusterLog
https://technet.microsoft.com/itpro/powershell/windows/failoverclusters/get-clusterlog
沒有留言:
張貼留言