I am trying to setup keepalived on ESXi based setup where 2 physical box have ESXi installed and each one having a node which works as load-balancer using HAProxy. Now in order to achieve high availability I want to use KeepAlived so both HAProxy instance can share virtual-ip and I can point physical-ip address to virtual-ip address. Challenge with my implementation is that it has 2 subnets.
HAProxy on subnet A: 1.1.10.101
HAProxy on subnet B: 1.2.10.101
Now how when I am trying to assign virtual-ip 1.1.10.201 on both instance then it is pointing to local instance on both Servers.
I am using CentOS 7.x with HAProxy and KeepAlived, primarily to load-balance HTTP traffic and possibly for database too.
I am not posting config file as question itself is very simple but if required I can do that.
Best Answer
There is an alternative way. 2 keepalived in differents network can communicate using
unicast_peer
(it will works as the same as if you have a VIP but you don't)Then you can use the
notify_script
to move a IP Failover (provided by your host for example) and make an API call to your provider to tell to move your IP Failover to another service when the keepalived transitioned to MASTER (there is anotify_master
rule).Example of my keepalived config:
Associated variables: