locked
Always on Listener port and connectivity RRS feed

  • Question

  • My MS SQL server default instance listen on port 1433.

    While configuring the "basic availbilty group", I assigned a different port (xxxxx)to the AG listener.

    In this case, will my application is able to connect with and without specifying the port number in the connection string. Is that how it is supposed to behave ?

    Satheesh
    My Blog | How to ask questions in technical forum

    Friday, March 2, 2018 8:05 AM

All replies

  • My MS SQL server default instance listen on port 1433.

    While configuring the "basic availbilty group", I assigned a different port (xxxxx)to the AG listener.

    In this case, will my application is able to connect with and without specifying the port number in the connection string. Is that how it is supposed to behave ?

    Satheesh
    My Blog | How to ask questions in technical forum

    Since you have specified port number for AG listener which is not 1433 you need to specify the port no when connecting from application using listener. If you dont specify port number connection would not happen from app via listener.

    Worth reading

    AG group Listener Named Instances and port Numbers


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Saturday, March 3, 2018 7:42 AM
  • However i am seeing my app is still able to connect to the SQL instance with out specifying the port number for listener. Thats what made me start this thread, 

    can you think of any reason why this would happen?


    Satheesh
    My Blog | How to ask questions in technical forum

    Monday, March 5, 2018 2:59 AM
  • However i am seeing my app is still able to connect to the SQL instance with out specifying the port number for listener. Thats what made me start this thread, 

    can you think of any reason why this would happen?


    Satheesh
    My Blog | How to ask questions in technical forum

    Can you show me the connection string please ?

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Monday, March 5, 2018 4:14 PM
  • This is what i have in my connection string

    Data Source={Hostname};Initial Catalog={Databasename};Integrated Security=SSPI;

    Or 

    Data Source={Hostname},{port};Initial Catalog={Databasename};Integrated Security=SSPI;

    app is able to connect using both connection string


    Satheesh
    My Blog | How to ask questions in technical forum

    Tuesday, March 6, 2018 3:21 AM
  • In above connection string where are you using Listener name ?. I guess you are connecting to SQL Server instance name of machine name and since it listens on default port it is directing you to instance in both the cases

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Tuesday, March 6, 2018 6:11 PM
  • In above connection string where are you using Listener name ?. 

    In both cases i tried with listener name and it connects. 

    Satheesh
    My Blog | How to ask questions in technical forum

    Wednesday, March 7, 2018 3:00 AM