Problem:
Detected unhealthy index state after adding a new server to the DAG or either problem occurs after a restart or failover;
1. The first step is to get your script ready for checking daily replications with your dag and detect this problem easy; This is the script code that you will need to generate the report, follow Paul’s guide in order to do so
Get-DAGHealth.ps1 – Database Availability Group Health Check Script
2. You can check also manually here clicking on properties of the database replica;
will tell you the index state and the status ( in or case its Crawling )
3. Getting hands on the issue
So we have detected unhealthy indexes what now?
The first step is to reseed the catalog using the following command :
Get-MailboxDatabaseCopyStatus * | where {$_.ContentIndexState -eq "Failed"} | Update-MailboxDatabaseCopy -CatalogOnly
Now this should sort your issue for now; If it does not :
Restart the server and repeat from point 1 ;
Make sure any active databases are moved to the other servers
Make sure the server is not assigned to Public Folders and if yes, public folders failover needs to be done
The index will appear in “Crawling state”