SQL Always On failed Join secondary Availability Replica

UrBel 300 Reputation points
2024-06-03T06:46:55.26+00:00

Hi Expert,

I had the issue when join secondary Availability Replica, either added by T-SQL or Wizard, the error message say:

".Cannot create availability replica for availability group [AGName] .An availability replica of specified Availability Group already exist on this instance of SQL Server...."

I tried to change the instance name of Availability replica e.g. SERVER01\AOG01 with SERVER01\AOG02... but it's same result!

great appreciation for your answer in advanced

warm regard,

Urbel

SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-06-04T01:54:36.32+00:00

    Hi @UrBel ,

    Thank you for reaching out and welcome to Microsoft Q&A.

    From the error message you provided:

    An availability replica of specified Availability Group already exist on this instance of SQL Server

    You changed the instance name of Availability replica and still added failed, I think the problem may appear in the AG where you want to add a replica, the name of this AG is incorrect or unique.

    You can try to find the AG. It may exist because you didn't create it correctly before.

    Try this:

    select * From sys.dm_hadr_name_id_map
    

    Then delete the AG which you didn't create it successfully:

    DROP AVAILABILITY GROUP AG_Name
    

    You can follow the steps in this article to recreate and add replicas, hope it can help you well.

    In addition, please:

    • Ensure that the always-on endpoint (Hadr_endpoint) is not blocked by the firewall (default port 5022).
    • Make sure that the primary server's startup account is added to all secondary servers, and that all secondary servers' startup accounts are added to the primary server.

    There is another thing to note is making sure your SQL Server account is the domain administrator account, this is my service account and AG nodes:

    User's image

    User's image

    Please feel free to share your issue here if you have any confused.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications

    1 person found this answer helpful.

  2. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2024-06-03T21:41:05.0766667+00:00

    Not sure that I see the point with changing the instance name. Rather you need to remove the replica that already exists, so you can put it back again. You may want to check what's in the current replica before you go ahead.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.