0

I have two HAProxy in different regions. Each haproxy have some instances for balancing.

Is it possible to use each of these proxies as a backup for another?

I found this article with examples:

https://www.haproxy.com/blog/failover-and-worst-case-management-with-haproxy/

I tried to use something like this:

...
backend bk_app_backup
  server second_haproxy.com x.x.x.x:443 check backup

But I got 502 Bad Gateway when I try to open https://x.x.x.x

Or, I can not use haproxy as a backup and should add all instances from backend of first haproxy config to second in backup section?

Something like this:

#first haproxy
...
backend http_back
  balance roundrobin
  server instance_a_01 x.x.x.x:443 check
  server instance_a_01 x.x.x.x:443 check

#second haproxy
...
backend http_back
  balance roundrobin
  server instance_b_01 x.x.x.x:443 check
  server instance_b_02 x.x.x.x:443 check
...
backend bk_app_backup
  server instance_a_01 x.x.x.x:443 check backup
  server instance_a_02 x.x.x.x:443 check backup
prosto.vint
  • 1,403
  • 2
  • 17
  • 30
  • The behavior you describe doesn't match the config. In fact, I'm not aware that a backup haproxy can be implemented in haproxy configs itself. This is usually solved with keepalived and floating IPs. People asked this before so you might want to check it out, [here](https://stackoverflow.com/a/38086336/2670428) – zokkker13 Aug 20 '19 at 21:31
  • Yes, I know about `keepalived`, but it requires both haproxies in the same network. My haproxis are in different netowrk zones. – prosto.vint Aug 21 '19 at 10:48

0 Answers0