This should be implemented using something like keepalived. Reference: http://behindtheracks.com/2014/04/redundant-load-balancers-haproxy-and-keepalived/