MS SQL Server Availability group listener port setup
0
votes
1
answer
201
views
There are a lot of useful, similar questions on this topic, as well as this part of the documentation (https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/availability-group-listener-overview?view=sql-server-ver15#SelectListenerPort) :
>You can also designate a non-standard availability group listener port. However, you also need to explicitly use the target port in your application connection string when connecting to a listener. You also need to open permission on the firewall for this port.
>
>You can connect to the listener using the name and port (if not 1433). **The port can be either the listener port or the underlying SQL Server port that it's configured to listen on.**
In this documentation there were practical examples of connection strings if you have 2 instances with port number 50254 and listener has port number 50123. It is shown that you can use either port number in your connection string.
So my question is if you use a default 1433 port for SQL instances and lets say some random port 50123, can you utilize the AG listener functionality which allows to login to the AG without specifying port - because the connection string will allow blank port number, since the instances are running on the default port? And is this considered an OK thing to do and are there any drawbacks of using this kind of approach?.
Edit:
And one more thing, instance I am running Availability group from is a named instance. And when I connect to the listener via listener\NamedInstanceName it doesn't need port number to successfully connect even though the port of both instances and listener is a non default port 50123. Is this a possible *safe* way to bypass the need of port in the connection string as well?
Asked by QuickGoose0
(1 rep)
Aug 8, 2024, 06:23 AM
Last activity: Aug 9, 2024, 02:49 PM
Last activity: Aug 9, 2024, 02:49 PM