0

I have a scenario where I want to create a SQL Server Distributed Availability Group (DAG) that spans across two existing Availability Groups (AGs) residing on the same set of SQL Server instances. Here's the setup:

  • I have an Availability Group named "ag1" with two replicas: "instance1" and "instance2".
  • I also have another Availability Group named "ag2" with the same two replicas: "instance1" and "instance2".

My goal is to create a Distributed Availability Group named "distag1" that encompasses both "ag1" and "ag2". I followed the documentation and attempted to create "distag1" on the global primary (the primary replica of "ag1"). It was created successfully. However, when I tried to join on the other end of "distag1" (the instance that ag2's listener points to), I encountered the following error:

ALTER AVAILABILITY GROUP distag1
JOIN AVAILABILITY GROUP ON
N'ag1' WITH (
    LISTENER_URL = N'TCP://ag1lsnr:5022',
    FAILOVER_MODE = MANUAL,
    AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT,
    SEEDING_MODE = MANUAL
),
N'ag2' WITH (
    LISTENER_URL = N'TCP://ag2lsnr:5022',
    FAILOVER_MODE = MANUAL,
    AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT,
    SEEDING_MODE = MANUAL
);


Msg 19509, Level 16, State 0, Line 38
Cannot create a distributed availability group 'distag1'. An availability group with the same name already exists.

My question is:

  • Is it supported to create a Distributed Availability Group across two Availability Groups that reside on the same set of SQL Server instances?
  • If it is supported, what could be causing the error message I encountered? Are there any specific requirements or considerations I need to take into account when creating a DAG in this scenario?

I would greatly appreciate any insights, clarifications, or guidance on this matter. Thank you in advance for your help!

1 Answer 1

2

Is it supported to create a Distributed Availability Group across two Availability Groups that reside on the same set of SQL Server instances?

No, it is not. Distributed Availability Groups were made to extend the use of an Availability Group past the replica limit and across disjointed Availability Group spaces (for example, across a Windows server 2016 cluster and Windows Server 2022 cluster, which normally wouldn't be possible).

Attempting to create the Distributed AG should result in the error you've received since it'll attempt to create the Distributed AG on all replicas twice (since they are both the source and the target) which will fail as there is already that Distributed Availability Group.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.