Create distributed AG

sakuraime 2,341 Reputation points
2021-08-09T04:57:17.037+00:00

Here is the sample tsql to create distributed AG
121554-image.png

is it a must to specify the URL of the LISTENER_URL ? Can I specify another IP addresses which is not as the listener ip( or interface).

If I use the listener IP address as the endpoint address, the replication traffic will go through the same network interface as the listener ip .

I would like to separate all the endpoint replication traffic to another network interface.

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2021-08-09T08:24:52.433+00:00

    Hi @sakuraime ,

    is it a must to specify the URL of the LISTENER_URL ?

    You can also use the way of FQDN.

    Can I specify another IP addresses which is not as the listener ip( or interface).

    Yes, you can.
    Port 5022: If you want to use annother port, you should ensure that the corresponding LISTENER_URL is the port you specify, otherwise the Availability Group cannot communicate through this port.
    Port 1433: https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/availability-group-listener-overview?view=sql-server-ver15#SelectListenerPort
    Note: LISTENER_URL: Notice that this parameter was used instead of ENDPOINT_URL. This parameter specifies the listener for each Availability Group along with the endpoint of the Availability Group – 5022 - not the endpoint of the listener - 1433.

    If I use the listener IP address as the endpoint address, the replication traffic will go through the same network interface as the listener ip .

    Normally, there will be no conflicts. Alwayson is based on clusters and Replication is not.
    Please see this article for examples.

    Best regards,
    Seeya


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    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.


  2. Seeya Xi-MSFT 16,586 Reputation points
    2021-08-16T11:02:38.657+00:00

    Hi @sakuraime ,

    Let's sort it out again:

    Suppose there are a total of four servers and two AGs.

    To begin with, the four servers are all 5022 ports (in order to avoid trouble, it is recommended to use the default 5022).
    The four servers are divided into two AGs, and each AG has its own listener. The port of the AG listener may not be 5022, it may be 4567 or other free interfaces, because it is only responsible for internal listening. Therefore, the ports of the two AGs can be different.
    There are two listeners in the DAG, which can be regarded as a special AG, and the port is still 5022 (the same as the previous server port, it is the default and is also for the purpose of interaction).
    Note: This DAG does not have its own listener.

    As for annother network you mentioned,
    From this link, we can see

    there are four scenarios:
    Both WSFC clusters are joined to the same domain.
    Each WSFC cluster is joined to a different domain.
    One WSFC cluster is joined to a domain, and one WSFC cluster is not joined to a domain.
    Neither WSFC cluster is joined to a domain.

    That is to say, like AG, we just need all the servers of each AG to be on the same cluster. It can be in the same domain or not. The example in the official document is that all servers are in the same domain named contoso.

    Finally, if you have any other questions, please feel free to let me know.

    Best regards,
    Seeya


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.