Availability databases hosted on SQL
Server Always On Availability Group (AG) can be connected using a unique
Virtual Network Name (VNN) called Availability Group Listener. When
Availability Group is enabled, clients can connect to databases in both primary
and secondary replicas without explicitly specifying the SQL Server instance
name. You don’t even need to know the instance name to connect to Availability
Group (AG).
When you have configured read-only
routing for secondary replicas and the application or client connection
contains the application intent as read-only, the listener will redirect the
connection to secondary readable replicas, Otherwise, the listener redirects
both read-write and read-only intent connections to primary replica. If there
is a fail-over, the listener will redirect connections to new primary and
secondary connections based on the application intent.
Related articles in Always On Availability Group:
Always On Availability Group Read-Only Routing
Windows Server Failover Cluster Quorum configuration for SQL Server Always On
Adding SSISDB to Always On Availability Group
Availability group listener consist of
following objects:
- Domain Name Systems (DNS)
- Listener Port
- One or more IP addresses (VIP)
The Listener is always owned by the
SQL Server instance where the primary replica resides. At the time of failover,
the new primary replica will own the listener.
Example:
- DNS:
salesag.mscorp.com
- Port:
1433
- IP: static or DHCP
Creating Availability Group Listener:
Availability Group Listener can be
created while creating Availability Group or it can be created post creating
the AG. The Listener creation options are available on Specify Replicas window and under the Listener tab.
If you want to skip the Listener
creation while creating Availability Group, you can leave the default option Do not create an availability group
listener now check the below image for reference:
New Availability Group - Specify Replicas |