25 September 2013

Verifying the file share witness server / directory in use for Exchange 2010

After trying a script that i was building, i received an unexpected error.

WARNING: Database availability group 'CL-XXXX' witness is in a failed state. The database availability group requires         
the witness server to maintain quorum. Please use the Set-      DatabaseAvailabilityGroup cmdlet to re-create the witness      
server and directory.

After some reading i came across this blogarticle.

In short:

To check the witness share(s):

Get-DatabaseAvailabilityGroup -Identity CL-XXXXX -Status | fl name,servers,witnessserver,witnessdirectory,alternatewitnessserver,

Name                      : DAG-Clustername                         
Servers                   : {SR-XXXX1, SR-XXXX2, SR-XXXX3, SR-XXXX4}
WitnessServer             : sr-CasHub1.domain.lan             
WitnessDirectory          : C:\DAGFileShareWitnesses\DAG-Clustername
AlternateWitnessServer    : sr-CasHub2.domain.lan                   
AlternateWitnessDirectory : C:\DAGFileShareWitnesses\DAG-Clustername
OperationalServers        : {SR-XXXX1, SR-XXXX2, SR-XXXX3, SR-XXXX4}
PrimaryActiveManager      : SR-XXXX3                                
WitnessShareInUse         : InvalidConfiguration

Check cluster resource using cluster commands

[PS] D:\Scripts>cluster cl-XXXXX.domain.lan res                     
Listing status for all available resources:                         

Resource             Group                Node            Status    
-------------------- -------------------- --------------- ------    
Cluster IP Address   Cluster Group        SR-XXXX3        Online    
Cluster Name         Cluster Group        SR-XXXX3        Online    
File Share Witness (
\\sr-XXXX1.domain.lan\CL-XXXXX.domain.lan)       Cluster Group        SR-XXXX3                             Failed    

Check cluster using cluster Powershell module

[PS] D:\Scripts>Import-Module FailoverClusters                     
[PS] D:\Scripts>Get-ClusterQuorum -Cluster cl-XXXXX.domain.lan | fl

Cluster        : CL-XXXXX                                          
QuorumResource : File Share Witness (
\\sr-XXXX1.domain.lan\CL-      XXXXX.domain.lan)                                                  
QuorumType     : NodeAndFileShareMajority                          

[PS] D:\Scripts>Get-ClusterResource "File Share Witness (\\sr-      XXXX1.domain.lan\CL-XXXXX.domain.lan)" -Cluster cl-XXXXX.domain.lan
| Get-ClusterParameter                                             

Object                        Name                                  Value                         Type                                 
------                        ----              -----                                        ----                                      
File Share Witness (
\\sr-X... SharePath         \\sr-               XXXX1.domain.lan\CL-1... String                                    
File Share Witness (
\\sr-X... ArbitrationDelay                      6                             UInt32                               

To correct the error:

Set-DatabaseAvailabilityGroup -Identity CL-XXXXX -WitnessServer sr-  XXXX1 -WitnessDirectory C:\DAGFileShareWitnesses\CL-XXXXX.domain.lan

And for the alternate witness directory:

Set-DatabaseAvailabilityGroup -Identity CL-XXXXX                     -AlternateWitnessDirectory C:\DAGFileShareWitnesses\CL-            XXXXX.domain.lan -AlternateWitnessServer SR-XXXX2                  


No comments:

Post a Comment