locked
In always configure RRS feed

  • Question

  • hi

    In always configure

    1)why we  are used Listerner

    2) In Listener need sql install before add the Listener in always on group

    Please clarify


    ajitkumar

    Saturday, February 15, 2020 9:31 AM

All replies

  • Always on provides high availability for the database, so the applications are accessible even when some Of the databases in that group are down. Each server in that group( availability group) has their own name. So, if one server is down and applications needs to repoint to another server, which means all the connection strings should be updated with the server name. Obviously, this is not a Full HA solution. So, in order to get around this problem we use listener. Listener is a virtual name that maps to server name(primary server) behind the scenes. When things failover, the listener updates to the new primary server. This way there is no work involved Changing the connection string during failover. You can just use listener name in the connection string. 2. We configure the listener name after the sql has been installed.

    Hope it Helps!!

    Saturday, February 15, 2020 2:10 PM
  • Hello ajitkumar:

    >>1)why we  are used Listerner

    Suppose we have two replicas using synchronous data commit mode. We can do read-write operations on the primary replica only. If failover happens, all user connections need to repoint to the new primary replica after failover. An availability group Listener enables a client to connect to an availability replica without knowing the name of the physical instance of SQL Server to which the client is connecting. The client connection string does not need to be modified to connect to the current location of the current primary replica.  So, it is great option to create a listener.

    More detail of listener, please refer to this article: https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/listeners-client-connectivity-application-failover?view=sql-server-ver15

    >>2) In Listener need sql install before add the Listener in always on group

    When you create first listener, you should install SQL Server first, then use SSMS to add it in  Availability Group Listener node.

    You can follow these tutorial to create a listener: https://www.sqlshack.com/sql-server-always-on-listeners/  &  https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/create-or-configure-an-availability-group-listener-sql-server?view=sql-server-ver15

    Hope it will help. Any further questions, please let us know.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Monday, February 17, 2020 2:49 AM
  • hi

    thanks for the reply,

    but still stuck in same question , we need lisnter ip before add the ag group sql server install, If need to install so what is the used


    ajitkumar

    Wednesday, February 19, 2020 7:21 AM
  • Hello ajitkumar,

    You can not create a listener before adding AG group, becase the listener is based on the AG group.

    Or what do you meaning? Could you help clarify more clear, thanks. 

    And if the reply is helpful to you, could you help 'mark as answer'? Thanks for your contribution.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, February 19, 2020 7:43 AM
  • hi

    thanks for the reply,

    but still stuck in same question , we need lisnter ip before add the ag group sql server install, If need to install so what is the used


    ajitkumar

    Listener would be kind of DNS name in AD so you would need IP and ofcourse a name for it. You can configure it after AG is configured or can do anytime after AG creation. 

    You need listener to make sure you always connect to Primary replica no matter what node is hosting it


    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

    Wednesday, February 19, 2020 9:21 AM
  • Hello ajitkumar,

    It seem you have solved the problem since I saw you ‘Vote a helpful post '. Could you change it to‘ Mark as answer ’? This can be beneficial to other community members finding and reading the thread easily. Making the forum more helpful is what we are working. Thanks for your understanding and support.

    In addition, if you have another questions, please feel free to ask.
    Thanks for your contribution.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, February 20, 2020 1:58 AM