如下表包含了常用排查的场景。根据被分为几个场景类型,比如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,并且在出问题的时候通知。