如下表包含了常用排查的場景。根據被分為幾個場景類型,比如Configuration,client connectivity,failover和performance。
Scenario
筆記
Scenario Type
Description
<a href="https://msdn.microsoft.com/en-us/library/ff878308(v=sql.110).aspx">Troubleshoot AlwaysOn Availability Groups Configuration (SQL Server)</a>
Configuration
提供了一些典型的配置AG執行個體發生問題的資訊。比如AG被禁用,賬号配置不正确,鏡像endpoint不存在(SQL Server Error 1418)。網絡通路不存在,join資料庫失敗(SQL Server Error 35250)。
<a href="https://support.microsoft.com/zh-cn/kb/2833122">Troubleshoot "Validating WSFC quorum vote configuration" warning</a>
當使用對話框建立AG時,收到一個警告: “The current WSFC cluster quorum vote configuration is not recommended for this availability group.”
<a href="https://support.microsoft.com/zh-cn/kb/2829783">Troubleshoot issues when creating availability group listeners</a>
在建立AG Listener的時候發生錯誤。
<a href="https://msdn.microsoft.com/zh-cn/library/hh510190(v=sql.110).aspx">Troubleshoot a Failed Add-File Operation (AlwaysOn Availability Groups)</a>
添加檔案導緻secondary資料庫挂起,狀态變為NOT SYNCHORNIZING
<a href="https://support.microsoft.com/zh-cn/kb/2711145">Fix: Error 41009 when you try to create multiple availability groups</a>
建立多個AG時發生41009 錯誤
<a href="https://support.microsoft.com/zh-cn/kb/2792139">Cannot connect to availability group listener in a multi-subnet environment</a>
Client Connectivity
建立了AG Listener之後,無法ping通和連接配接
<a href="https://support.microsoft.com/zh-cn/kb/2833707">Troubleshoot failed automatic failovers</a>
Failover
自動故障轉移不能成功完成
<a href="https://msdn.microsoft.com/en-us/library/dn135336(v=sql.110).aspx">Troubleshoot: Availability Group Exceeded RTO</a>
Performance
自動故障轉移或者計劃内的手動轉移之後,切換時間超過了RTO時間
<a href="https://msdn.microsoft.com/en-us/library/dn135317(v=sql.110).aspx">Troubleshoot: Availability Group Exceeded RPO</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4981484.html">排查:AG超過RPO</a>
強制故障轉移後,都是的資料超過了RPO。或者異步送出的replica能夠承受的資料丢失超過了RPO。
<a href="https://msdn.microsoft.com/en-us/library/dn135335(v=sql.110).aspx">Troubleshoot: Changes on the Primary Replica are not Reflected on the Secondary Replica</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4982563.html">排查:Primary上的修改無法在Secondary展現</a>
用戶端程式可以成功的完成primary的修改,但是查詢replia卻沒有反應。
以下工具可以用來排查,配置時或者運作時發生的問題
Tool
<a href="https://msdn.microsoft.com/zh-cn/library/hh213474(v=sql.110).aspx">Use the AlwaysOn Dashboard (SQL Server Management Studio)</a>
在UI接口下,擷取某個時間點的AG健康情況。
<a href="https://msdn.microsoft.com/zh-cn/library/dn135316(v=sql.110).aspx">AlwaysOn Policies</a>
被Alwayson Dashboard使用
<a href="https://msdn.microsoft.com/en-us/library/dn135318(v=sql.110).aspx">SQL Server Error Log (AlwaysOn Availability Groups)</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4984290.html">SQL Server錯誤日志(AG)</a>
記錄AG,副本,資料庫,其他AG主鍵的狀态變化,和AG的錯誤
<a href="https://msdn.microsoft.com/en-us/library/dn135314(v=sql.110).aspx">CLUSTER.LOG (AlwaysOn Availability Groups)</a>
記錄叢集時間,包括AG資源的狀态變化,SQL Server resource DDL的事件和錯誤。
<a href="https://msdn.microsoft.com/en-us/library/dn135337(v=sql.110).aspx">AlwaysOn Health Diagnostics Log</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4984594.html">AlwaysOn健康診斷日志</a>
<a href="https://msdn.microsoft.com/en-us/library/dn135319(v=sql.110).aspx">Dynamic Management Views and System Catalog Views (AlwaysOn Availability Groups)</a>
報告AG的資訊,比如配置,健康狀況,性能問題
<a href="https://msdn.microsoft.com/en-us/library/dn135324(v=sql.110).aspx">AlwaysOn Extended Events</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4986409.html">AG擴充事件</a>
提供了詳細AG資訊用來診斷,分析起因
<a href="https://msdn.microsoft.com/en-us/library/dn135332(v=sql.110).aspx">AlwaysOn Wait Types</a>
提供了AG特定的等待資訊,用來調整性能
AlwaysOn Performance Counters
<a href="https://msdn.microsoft.com/en-us/library/dn135320(v=sql.110).aspx">AlwaysOn Ring Buffers</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4986900.html">AlwaysOn Ring Buffers</a>
記錄SQL Server系統内部争端的警告,用來debug和AG有關的問題。
理想的排查時間是在故障轉移之前。這個可以通過監控性能值,在超過SLA之前發送告警。比如同步secnodary副本有性能問題,因為預計failover時間增加。AG是高可用和災難恢複解決通路,最重要的性能名額是切換時間,會影響RTO,災難導緻的資料丢失會影響RPO。
以下表文章用來監控AG的健康狀況:
Topic
<a href="https://msdn.microsoft.com/en-us/library/dn135338(v=sql.110).aspx">Monitor Performance for AlwaysOn Availability Groups</a>
描述AG資料同步,閥值控制,和一些有用的值用來監控AG,還有如何收集RTO,RPO的值。
<a href="https://msdn.microsoft.com/zh-cn/library/ff877954(v=sql.110).aspx">Monitoring of Availability Groups (SQL Server)</a>
提供一些AG監控工具
<a href="http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/09/overview-of-the-alwayson-manageability-health-model.aspx">The AlwaysOn Health Model Part 1 -- Health Model Architecture</a>
提供一個Alwayson健康模型的概述
<a href="http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/extending-the-alwayson-health-model.aspx">The AlwaysOn Health Model Part 2 -- Extending the Health Model</a>
<a href="http://www.cnblogs.com/Amaranthus/p/4997621.html">健康模型 Part 2 ——擴充</a>
如何使用者定制Alwayson監控模型和使用者定義Alwayson Dashboard,來顯示額外的資訊。
<a href="http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/monitoring-alwayson-health-with-powershell-part-1.aspx">Monitoring AlwaysOn Health with PowerShell - Part 1: Basic Cmdlet Overview</a>
提供一些基本的Alwayson Powershell指令。用來監控AG的健康狀況。
<a href="http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/monitoring-alwayson-health-with-powershell-part-2.aspx">Monitoring AlwaysOn Health with PowerShell - Part 2: Advanced Cmdlet Usage</a>
提供一些進階的Alwayson Powershell指令。用來監控AG的健康狀況。
<a href="http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/15/monitoring-alwayson-health-with-powershell-part-3.aspx">Monitoring AlwaysOn Health with PowerShell - Part 3 : A Simple Monitoring Application</a>
顯示如何使用城區監控AG。
<a href="http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/15/the-always-on-health-model-part-4.aspx">Monitoring AlwaysOn Health with PowerShell - Part 4 : Integration with SQL Server Agent</a>
如何使用SQL Server Agent內建監控AG,并且在出問題的時候通知。