0

I have an application which I need to set up in active-passive mode behind the load balancer such that all connections should go to the active instance. If the active instance go down, it should start sessions from passive one.

The only info I gather was that we could only set up active instances behind the load balancer and it will distribute the load across them.

Appreciate any leads here.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
Ani
  • 463
  • 4
  • 20

2 Answers2

2

As Gaurav say, we can use Azure Traffic Manager to achieve active-passive module. Traffic Manager is a DNS level load balancer.

For now, we can't set active-passive module behind Azure Load Balancer.
As a workaround, we can deploy Haproxy, and set node1 as master and node2 used as backup:

-------------
 |  HAProxy  |
 -------------
  |         `
  |active    ` backup
  |           `
------       ------
| node1 |       | node2 |
------       ------

The configuration below makes HAProxy to use node1 when available, otherwise fail over to node2 if available (automatic failover and failback):

global
   log /dev/log local0
   log /dev/log local1 notice
   chroot /var/lib/haproxy
   stats socket /run/haproxy/admin.sock mode 660 level admin
   stats timeout 30s
   user haproxy
   group haproxy
   daemon

defaults
   log global
   mode http
   option httplog
   option http-server-close
   timeout connect 4s
   timeout client 20s
   timeout server 20s

frontend ft_app
   bind 10.0.0.6:80
   default_backend bk_app

backend bk_app
   server node1 10.0.0.4:80 check
   server node2 10.0.0.5:80 check backup

In this way, we can achieve active-passive module.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • what would you suggest? Use haproxy or use azure traffic manager? – Ani Apr 26 '17 at 12:01
  • @AnimeshJain DNS cache will efect the traffic manager failover, in my opinion, I think Haproxy is better than Trafic manager. – Jason Ye Apr 26 '17 at 12:37
  • Sounds perfect..actually traffic manager also do not give option to configure multiple parameters like number of healthchecks, duration between healthchecks etc.. Will go with haproxy :) Thanks a lot – Ani Apr 27 '17 at 06:37
  • just a thought...can we use azure functions with load balancer to setup active-passive mode? – Ani Apr 27 '17 at 06:40
  • @AnimeshJain Sorry, I'm not good at Azure functions, according to the official article, it seems that we can't use Azure functions with Azure load balancer. https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview#a-nameintegrationsaintegrations ,Please let me know if you would like further assistance. – Jason Ye Apr 27 '17 at 06:56
  • @AnimeshJain If it helps, please mark it as an answer, thanks. – Jason Ye Apr 27 '17 at 07:32
0

You should take a look at Traffic Manager service from Azure. It supports various routing methods to route traffic between various service endpoints. The routing method which I believe is relevant to you is Priority. From this link:

Priority: Select 'Priority' when you want to use a primary service endpoint for all traffic, and provide backups in case the primary or the backup endpoints are unavailable.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • Traffic manager was indeed able to do so and surfaced my requirements. I am looking at the fact that since it is DNS level load balancer, will it have any underlying issues? – Ani Apr 26 '17 at 12:02