SQL Server – Assigning Port to Listener in AlwaysOn

availability-groupssql server

We have multiple instances on single node of the AlwaysOn setup, all are configured as AOAG. Right now we are connecting using the Listener\InstanceName. The listeners for each AG is having a dedicated port designated. This is why we cannot connect just by using the Listener without the port or InstanceName.

I wanted to configure in such a way that just giving the AG_Listener would be enough to connect without using the port explicitly.

Example : AG-SQL001 instead of AG-SQL001,Port_Number

Can this be done ? If yes then how?

Best Answer

Right now we are connecting using the Listener\InstanceName

The listener does not actually interact with the Browser service, and thus I wouldn't use this way with a listener - ever.

I wanted to configure in such a way that just giving the AG_Listener would be enough to connect without using the port explicitly.

Set the listener for port 1433. The listener uniquely identifies the instance of SQL Server and there can be multiple listeners all using 1433 as each listener has a unique IPv4 and/or IPv6 address. Note that there are other means to which SQL Server can be connected through when there are multiple instances on the same server which may or may be appropriate or correct ways of connecting.