Sql-server – Why is the DR AG database in the “recovery pending” state

availability-groupsfailoversql serversql-server-2016

I am trying to build an architecture where we get automatic failover for both HA and DR for our DBs using SQL Server 2016 AlwaysOn Availability Groups. When I tested this using only one Availability Group, the DR DB said it was in a 'recovery pending state'.

Do I need to put the same DB on two Availability Groups to avoid the Quorum problem (one for HA and one for DR)?

Is it possible to have one DB on 2 AGs (one AG for a AG Cluster and one only for DR)?

Best Answer

You cannot put one database into multiple availability groups. The likely cause of the recovery pending state is related to your cluster configuration. If you only have two nodes and no file share or disk witness then your cluster can sustain 0 node failures.

If you're testing by shutting down node 1 and you don't have a quorum witness (file share or disk) then node 2's cluster service will stop and the AG will not bring the databases online.

Run a cluster validation to confirm how many node failures the cluster can sustain (needs to be at least 1) and validate your quorum configuration.