0

I have application deployed on tomcat server on machine A,B,C,D I want to load balance using the Nginx using two load balancer nodes LB1 & LB2.

All documents talks about using single node as load balancer.is it possible using two Nginx node as load balancer?

If we have a critical application running on server require the zero down time. If we go with one LB and for some reason LB itself fails,then there will be an issue.

  • [See also](http://serverfault.com/questions/733177/how-to-create-a-high-availability-application-server/733195). – gxx Feb 14 '16 at 11:04

2 Answers2

0

The way to do this without a hardware loadbalancer in front of nginx is using something like keepalived It allows you to create a VIP (Virtual IP) address that floats between the two nginx servers. So how it works is keepalive runs in active/standby mode so 1 nginx server is taking all the traffic and has the VIP attached to it. As soon as the standby server sees the active server down it tells the upstream switch the VIP is over here now so update your MAC table and send traffic to me now.

Mike
  • 22,310
  • 7
  • 56
  • 79
0

Use VRRP/CARP to create active/passive HA-cluster. On Linux user ucarp, on FreeBSD use if_carp(4). Everything besides that is like for one nginx balancing instance. server {} of course has to be listening on CARP address.

drookie
  • 8,625
  • 1
  • 19
  • 29