Impact of domain change of servers in availability group

Recently I faced an issue where secondary replica was showing as disconnected in always on availability group.  Below troubleshooting was done to fix the issue.

  1. Checked and verified that secondary replica server was up and online.
  2. SQL services were also up and running fine on secondary replica server.
  3. Was able to connect to secondary replica SQL instance from primary replica server using the domain account.
  4. As secondary replica connectivity was fine from primary replica server, tried to remove the secondary replica and databases from the availability group and add them again and got below warning message for the endpoints.

    The Endpoints tab lists at least one endpoint that uses only Windows Authentication. However, the server instance might be running under a non-domain account. To use the listed endpoint, change the corresponding SQL Server service account to a domain account. To continue using the non-domain account, alter the endpoint to use a certificate.
    Do you want to use the listed endpoints?
    YES OR NO


  5. Checked and verified that endpoints for both primary and secondary replica were using domain accounts but still getting above error. Went ahead with listed endpoints and secondary replica was still shoing as disconnected.
  6. Decided to create a test availability group to check if it works and observed that for new availability group endpoint was in different domain from the domain of existing endpoint.
  7. Found that both server’s domain was recently changed from “abc.com” to “xyz.com” but existing availability group’s primary replica’s endpoint was still showing as “TCP://<Primary Server>.abc.com:5022”
  8. Went ahead and changed the endpoint URL for primary replica using below command

    ALTER AVAILABILITY GROUP [AG]
    MODIFY REPLICA ON 'Primary Server' WITH (ENDPOINT_URL = 'TCP://<Primary Server>.xyz.com:5022');


  9. Once endpoint url was updated, secondary replica started showing as connected and we added the databases back to availability group.

In summary, DBA should ensure to update endpoint URLs in availability group configuration if server’s domain is changed to avoid any issue. This does not require a downtime .

Hope this article will help you!

Happy Learning!!