1

I have a cluster-less AG (read scale AG) without a listener.

Our network admin has set DNS entry to point to primary node. All applications use that DNS name for database connections.

Post failover our network team edits the DNS records to point to the new primary node.

I'm reading about adding listener to the AG and understand the purpose of it being connectivity to readable secondary via read intent in the connection string.

It seems that the listener must be pointed to the primary node ip (is this when creating the listener or is this in the DNS?).

And after failover, the listener IP must be updated to point to the new primary node IP (is this in the listener settings or in the DNS?)

I did a right click on the AG listener folder and have setup a listener with name test_listener and the IP of the current primary node (is this correct or do I have to give a new IP here?). However I'm unable to connect using this listener, the error indicates that it's not present on the network. Does this listener name also need to be registered in the DNS manually with IP of current primary node? Does this mean network team now will have to maintain 2 entries to point to the current primary? One existing and the other for the listener?

Interestingly, read intent redirection to readable secondary works even without using the listener (all I need to do is use the primary server name/ip and specify read intent and db name, and the query gets redirected to the secondary node). So what purpose does a listener serve in a read scale AG?

asked Jun 8, 2024 at 3:04

1 Answer 1

1

It seems that the listener must be pointed to the primary node ip [...]

Correct.

And after failover, the listener IP must be updated to point to the new primary node IP [...]

Correct.

However I'm unable to connect using this listener, the error indicates that it's not present on the network.

Connect using the node name/DNS entry. The listener doesn't actually exist on the network (it doesn't register anything with DNS) and it's not meant to for Read Scale.

Does this listener name also need to be registered in the DNS manually with IP of current primary node?

Nope.

Does this mean network team now will have to maintain 2 entries to point to the current primary?

No, it means Read Scale is a lot more trouble than it is generally worth. You only need to drop and re-add the listener upon failover.

answered Jun 8, 2024 at 20:55
7
  • 1
    I still don't understand what is the purpose of setting up a listener in this case. If I setup listener with name XYZ and IP of primary, and no one can connect to the listener from their SSMS using the name XYZ, then what purpose does the listener serve? Commented Jun 9, 2024 at 1:28
  • None. The listener only helps to redirect connections to AG replicas in a cluster. It's purpose is to create a listening TCP/IP socket only on the node hosting the primary replica, so clients can use a single hostname to connect. Commented Jun 9, 2024 at 15:14
  • David is correct, in Read Scale it has no purpose as a listener. You need to set it up so that read only routing prerequisites are satisfied. @variable Commented Jun 10, 2024 at 9:49
  • I tried that without a listener also I can connect to readable secondary by connecting to primary with readintent and an AG db name. So I'm not understanding what is the need of listener at all. Commented Jun 10, 2024 at 12:54
  • 1
    @variable then something else is incorrect in your setup. That's not how it works and requires the listener. I cannot reproduce your findings and the Docs don't agree with you. Commented Jun 12, 2024 at 10:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.