Überwachen von Verfügbarkeitsreplikatrollen

Microsoft.SQLServer.2012.AlwaysOn.AvailabilityReplicaRoleState (UnitMonitor)

Verfügbarkeitsreplikatrolle

Knowledge Base article:

Zusammenfassung

Dieser Bildschirm führt ein Rollup des Status der Rolle aller Verfügbarkeitsreplikate aus und überprüft, ob Verfügbarkeitsreplikate vorhanden sind, die keine fehlerfreie Rolle aufweisen. Der Monitor befindet sich in einem fehlerhaften Zustand, wenn jedes Verfügbarkeitsreplikat weder primär noch sekundär ist. Andernfalls befindet sich der Monitor in einem ordnungsgemäßen Zustand.

Ursachen

In dieser Verfügbarkeitsgruppe verfügt mindestens ein Verfügbarkeitsreplikat derzeit nicht über die primäre oder sekundäre Rolle.

Lösungen

Verwenden Sie den Verfügbarkeitsreplikat-Monitorstatus, um nach dem Verfügbarkeitsreplikat zu suchen, dessen Rolle nicht primär oder sekundär ist, und beheben Sie das Problem des Verfügbarkeitsreplikats.

Element properties:

TargetMicrosoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeMicrosoft.SQLServer.2012.AlwaysOn.SystemPolicyScriptMonitorType
RemotableTrue
AccessibilityPublic
RunAsMicrosoft.SQLServer.2012.AlwaysOn.MonitoringAccount

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.AlwaysOn.AvailabilityReplicaRoleState" RunAs="Microsoft.SQLServer.2012.AlwaysOn.MonitoringAccount" TypeID="Microsoft.SQLServer.2012.AlwaysOn.SystemPolicyScriptMonitorType" Accessibility="Public" Enabled="true" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Target="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth" Priority="Normal">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="HealthState" HealthState="Success"/>
<OperationalState ID="Critical" MonitorTypeStateID="ErrorState" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<Interval>900</Interval>
<TimeoutSeconds>300</TimeoutSeconds>
<PolicyName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/AvailabilityGroupName$-AlwaysOnAgReplicasRoleHealthPolicy</PolicyName>
<InstanceName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/InstanceName$</InstanceName>
</Configuration>
</UnitMonitor>