0

I have several geographical regions for my service deployment, say Region1, Region2, and Region3. Each region has a failover haproxy instance. Each haproxy is configured with several backend servers that get passed requests to their private IP's.

I use a DNS based load balancing solution to direct each countries traffic to the fastest available region. The DNS solution has failover capability, but due to TTL's, monitoring intervals, and propagation times, this can take a little while.

If one datacenters backends are having issues, I'd like that regions HAProxy to direct the traffic to the other regions that are online (using the "allbackups" option, with httpchk enabled on the backups) to serve the requests even with increased latency, until the issue is resolved locally or DNS failover kicks in. Initially this sounded like a good idea, but now I'm thinking that this will cause a cyclical redirect at times, and wondering if anyone has suggestions on how to implement such a setup (or better alternative configurations).

Example for my description above:

region1-haproxy

  • r1b1 (private)
  • r1b2 (private)
  • region2-haproxy (public) backup
  • region3-haproxy (public) backup

region2-haproxy

  • r2b1 (private)
  • r2b2 (private)
  • region1-haproxy (public) backup
  • region3-haproxy (public) backup

region3-haproxy

  • r3b1 (private)
  • r3b2 (private)
  • region1-haproxy (public) backup
  • region2-haproxy (public) backup
JesseP
  • 196
  • 1
  • 1
  • 6

1 Answers1

0

I am looking in to something similar for my AWS based production envt, I think that using heartbeat can be a good solution in your case. I plan to use heartbeat between two of my HAProxy servers and if one goes down I plan to assign the Elastic IP to the machine which becomes my main server now. I would suggest looking in to hearbeat and here is another link which I found useful for this scenario:

HA-HAProxy

APZ
  • 954
  • 2
  • 12
  • 25