I've been using HAProxy for quite a while but recently got this issue that I don't really know how to implement/solve.
+---------------------------+
client-europe \ | HAProxy europe (10.1.0.1) | / data-center-europe
|---| |->
client-states / | HAProxy states (10.2.0.1 | \ data-center-states
+---------------------------+
User's will mainly connect via IP stating both proxys in the configuration; something in the likes of app.servers=10.1.0.1,10.1.0.2
. What I would like to achieve:
- if only one HAProxy is up use that
- if both HAProxy's are up route client to the nearest one
- prefer data-center closer to HAProxy (solved)
So having HAProxy chose a backend is solved. What I can't do is route the user to another HAProxy. Something in the likes of (hey, I've detected you're connecting from Europe so I'm re-directing you to the 10.1.0.1 ip address).
0 Answers