how to fail over from primary LB to secondary LB using traffic manager

sns 9,226 Reputation points
2023-01-20T16:18:43.62+00:00

how to fail over from primary LB to secondary LB using traffic manager, Please suggest.

Azure Traffic Manager
Azure Traffic Manager
An Azure service that is used to route incoming network traffic for high performance and availability.
110 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
401 questions
0 comments No comments
{count} votes

Accepted answer
  1. SanthiSwaroopNaikBukke-4908 595 Reputation points
    2023-01-20T17:30:51.5966667+00:00

    You can use Azure Traffic Manager to failover from a primary load balancer to a secondary load balancer. Here are the general steps to set up Traffic Manager for failover:

    1. Create two Azure Load Balancer instances, one for the primary load balancer and one for the secondary load balancer.
    2. Create an Azure Traffic Manager profile, and configure it to use the "Performance" routing method.
    3. Add the primary load balancer as the first endpoint to the Traffic Manager profile.
    4. Add the secondary load balancer as the second endpoint to the Traffic Manager profile.
    5. Configure the endpoint monitoring for both the primary and secondary load balancers.
    6. Configure the endpoint status to "Enabled" for the primary load balancer and to "Disabled" for the secondary load balancer.
    7. Test the failover by shutting down the primary load balancer or by simulating an outage.
    8. Once the failover is working as expected, you can configure the DNS settings to point to the Traffic Manager endpoint.

    When the primary load balancer is healthy and available, Traffic Manager will route the traffic to the primary load balancer, and when it becomes unavailable, Traffic Manager will automatically route the traffic to the secondary load balancer.

    It's important to note that there may be a small amount of downtime during the failover process, as the traffic is being routed to the secondary load balancer.

    Also you can use "Failover" routing method instead of "Performance" routing method, In this case you can configure the primary endpoint as the active endpoint and the secondary endpoint as the standby endpoint. This allows you to test the failover by simulating a failure on the active endpoint.

    It's important to keep monitoring the load balancers and traffic manager to ensure that they are working as expected, and to troubleshoot any issues that may arise.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 47,011 Reputation points Microsoft Employee
    2023-01-20T18:06:46.18+00:00

    Hello @sns ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know how to fail over from primary load balancer to secondary load balancer using Azure traffic manager.

    You can combine Azure Public load balancers with Azure Traffic manager priority routing method to setup automatic failover from primary LB to secondary LB with minimal downtime. You can refer the below article which shows the implementation of such a scenario.

    Reference: https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/n-tier/multi-region-sql-server

    Azure traffic manager priority routing is selected when you want to have a primary service endpoint for all traffic. You can provide multiple backup endpoints in case the primary or one of the backup endpoints is unavailable. The Traffic Manager profile contains a prioritized list of service endpoints. By default, Traffic Manager sends all traffic to the primary (highest priority) endpoint regardless of the availability of all endpoints. If the primary endpoint isn't available, Traffic Manager routes the traffic to the second endpoint.

    Even when both the regions are active, the traffic manager will route the traffic to the highest-priority endpoint and only route the traffic to secondary when primary fails/degrades.

    Refer: https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-routing-methods#priority-traffic-routing-method

    https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-monitoring

    So, you can create a Traffic Manager with the routing method of set to Priority. Add both the public load balancers as the Traffic manager endpoints using their respective Public IP addresses. And add their respective priority numbers. For the Primary LB, add priority 1 and for the secondary LB, add priority 2.

    Refer: https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-configure-priority-routing-method

    NOTE: As explained in How Traffic Manager Works, a Traffic Manager endpoint can be any internet facing service hosted inside or outside of Azure. Hence, Traffic Manager can route traffic that originates from the public internet to a set of endpoints that are also internet facing. If you have endpoints that are inside a private network (for example, an internal version of Azure Load Balancer) or have users making DNS requests from such internal networks, then you can’t use Traffic Manager to route this traffic.

    Refer: https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-faqs#what-types-of-traffic-can-be-routed-using-traffic-manager

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments