change listener port no effect

Jiong AN 146 Reputation points
2021-10-23T07:17:18.76+00:00

i changed alwayson AG listener port from default 1433 to 12345 in SSMS . But clients are still able to reconnect through the listener without specified the new port number. The alter availability group 'AG' modify listener .... (port=12345) seems has no effect.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,757 questions
Windows Server Clustering
Windows Server Clustering
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Clustering: The grouping of multiple servers in a way that allows them to appear to be a single unit to client computers on a network. Clustering is a means of increasing network capacity, providing live backup in case one of the servers fails, and improving data security.
959 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,554 questions
{count} votes

Accepted answer
  1. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2021-10-25T07:04:12.99+00:00

    Hi JiongAN-1498,

    Does your primary replica listen on the default port?
    If so, the listener can use default 1433 and 12345 when the alwayson is hosted on primary node.
    But if your alwayson fails over to another node, and that node is not listening on port 1433, then the AG listener connection via port 1433 will fail.
    So please specify the port in the connection string in the format of listenername,port if the port is not 1433.

    Best Regards,
    Amelia


    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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Limitless Technology 39,371 Reputation points
    2021-10-25T19:47:48.77+00:00

    Hello @Jiong AN

    Is it possible that you have created Multiple Listeners instead of changing the default port?

    Reference: https://techcommunity.microsoft.com/t5/sql-server/how-to-create-multiple-listeners-for-same-availability-group/ba-p/384028

    How to change the default port: https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/create-or-configure-an-availability-group-listener-sql-server?view=sql-server-ver15

    Hope this helps with your query,

    -------
    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments