I'm trying to make a distributed availibility group works.
I start from a working AG, and I'm implementing a DAG for disaster recovery.
Currently the AG (named AGITA) is configured on 3 physical servers. So I have a failover istance that can move on server 1 or 2 and a local istance on 3rd server.
On the AG in DR (named AGRUS) I have 2 servers with one locale istance each. To semplify, the infrastructure is:
In addition to this, each AG is accessed via a listener on port 65000.
Each istance has it's own endpoint, listening on port 5022.
Windows is version 2012R2, SQL is 2016 SP1, CU5 - enterprise version.
First obstacle to create a DAG is that the 2 networks cannot communicate directly. So we added an interface to a dedicated network, called SYNC_NETWORK.
In order to make them communicate we added an IP to listeners on SYNC_NETWORK:
ALTER AVAILABILITY GROUP [AGITA] MODIFY LISTENER N'AGLISTITA' (ADD IP (N'10.100.1.80', N'255.255.255.0'));
And did similar on AGRUS, added net routes to servers and DNS records for interface.
NOTE: when you add a listener you can only bring it on with failover cluster manager. You can then verify with:
SELECT * FROM sys.availability_group_listener_ip_addresses;
To create distributed availibility group I read documentations and example, everyone indicates for LISTENER_URL the address of the listener, but port of endpoints (but why?).
Endpoints are created on each istance to listen on all addresses:
CREATE ENDPOINT [endpoint_namedendpoint] STATE=STARTED AS TCP (LISTENER_PORT = 5022, LISTENER_IP=ALL) FOR DATA_MIRRORING (ROLE=ALL,AUTHENTICATION=WINDOWS NEGOTIATE,ENCRYPTION=REQUIRED ALGORITHM AES) GO
This is where weird things starts:
If, in AGITA primary is on LI_01 (the local istances) everything runs fine. In this case listener has open ports, both 65000 and 5022.
The problem is: when AGITA works on FI_01 (the failover istance) listener has just port 65000 open.
Port 5022 is listening on istance ip (not in the sync network), not reachable from DR site. So my DAG stop working with errors:
A connection timeout has occurred while attempting to establish a connection to availability replica...
I also tryed to make DAG working on port 65000, but I get errors of corrupted network packets.
So.. How can I make DAG communicate when AGITA is working on FI_01?