Share via

Standard SQL 2019 basic availability group and the listener

shengling coady 21 Reputation points
2021-12-07T18:11:32.397+00:00

Hi,
I am new to the Standard SQL 2019 basic availability group and the listener.
Please correct me, if I am wrong. The listener lives on the primary, and it's set up with a DNS name.
Application points to the listner DNS name.

My questions are when the primary failed over to replica, and now the replica is the new primary.

  1. Does the listener automatically move to the new primary?
  2. Anything we need to change on the application to point to the listener?

Thank you very much.

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

Answer accepted by question author

YufeiShao-msft 7,156 Reputation points
2021-12-08T02:33:11.123+00:00

Hi @shengling coady

Does the listener automatically move to the new primary?

The Availability group (AG) listener directs incoming connections to either primary or read replica depending on how the AG is configured (whether it allows read requests or not).

An availability group listener is a virtual network name (VNN) that clients can connect to in order to access a database in a primary or secondary replica of an Always On availability group without explicitly specifying the SQL Server instance name. You don’t even need to know the instance name to connect to an AG.

During a failover, all client requests are terminated. After the failover, when a client reconnects to the AG listener, the listener will reconnect to the new primary (except for read intent connect requests).

Anything we need to change on the application to point to the listener

Specify the availability group listener DNS name in the connection string to connect to the primary replica for read-write access, For example, to connect to the primary replica in SQL Server Management Studio through the listener, enter the listener DNS name in the server name field: During a failover, when the primary replica changes, existing connections to the listener are disconnected and new connections are routed to the new primary replica.

-------------

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.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

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.