MSSQL AG Listener - possible to setup listener for multiple replicas?

376 Views Asked by At

Is it possible to setup AG in sucha a way that Listener will work for 3+ replicas? I'd like to be able to connect to database using Listener, not matter which replica is Primary one, but I'm not understading how this should work.

Here's my setup in Azure (Windows Server 2019, SQL Server 2019)

Subnet-1:

ServerA, ServerB - for HA

Subnet-2:

ServerC - for DR

Each Server has primary and secondary (dedicated for listener) IP address.

ServerA - 10.0.1.7, 10.0.1.8

ServerB - 10.0.1.9, 10.0.1.10

ServerC - 10.0.2.5, 10.0.2.6

I connected them all in cluster and configured AG successfully.

Configured Listener - AGListener with secondary IP of ServerA and ServerC - 10.0.1.8, 10.0.2.6

It works fine when I connect to AGListener when Primary replica is either A or C, but just for tests I failedover to B and then it timeouts.

Is there a way to configure Listener to work on all replicas? Especially if we have more than 3?

This is not PRD setup, just trying different things in lab.

0

There are 0 best solutions below