Re: Can't bind to Virtual IP

From: Graeme Donaldson <graeme#donaldson.za.net>
Date: Thu, 11 Aug 2011 16:29:29 +0200


On 11 August 2011 16:16, Ran S <ran#sheinberg.net> wrote:

> Hello,
>
> I am trying to set up a binding to a Virtual IP in order to use master and
> slave HAProxy load balancers.
> I am following each of the two following guides:
>
>
> http://www.highscalable.org/haproxy-and-keepalived-for-highly-performance-load-balancing-web-technique
>
> http://www.howtoforge.com/setting-up-a-high-availability-load-balancer-with-haproxy-heartbeat-on-debian-lenny-p2
>
> But the majority of the guides are not relevant to my problem. as far as I
> understand, in order for a frontend to use a different IP than the machine's
> IP (in an internal network), all is needed is:
>
> 1. In HAProxy.cfg set, under a listen or frontend node:
> bind <some-nonexistent-ip>:<someport>
> 2. In /etc/sysctl.conf
> add
> net.ipv4.ip_nonlocal_bind=1
> and run
> sysctl -p
>
> At this point the <some-nonexistent-ip> should be reachable from the
> network? in my case, it simply doesn't happen. should I see it under
> ifconfig on the machine?
> I realize this may not be the best place to ask the question, but it's very
> relevant to HAProxy for redundancy purposes.
>

You're almost there. What you have done so far is configured your system so that HAproxy can *bind* an IP that doesn't exist on the machine. In order to actually use that IP, it still must be bound to the machine. This is typically done using keepalived, which is described in the first link you mention (
http://www.highscalable.org/haproxy-and-keepalived-for-highly-performance-load-balancing-web-technique). I suggest you configure keepalived as described in that article.

Regards,
Graeme. Received on 2011/08/11 16:29

This archive was generated by hypermail 2.2.0 : 2011/08/11 16:45 CEST