Re: ha-proxy strange behavior with check localhost option

2015-08-10 Thread Holger Just
Hi BLN,

bln prasad wrote:
 I'm not sure why health check is failing if it's localhost on few
 systems and this is observed with only 1.5.14 version.
 ideally there should not be any difference between localhost and
 127.0.0.1 right.

Localhost can resolve to several different IPs, including

* any in the network of 127.0.0.0/8, most commonly 127.0.0.1
* ::1 (the defined localhost address in IPv6)

The most common issue here is indeed the difference between IPv4 and
IPv6. If your server is IPv6 aware, HAProxy might try to connect to ::1
only. If your service only listens on 127.0.0.1 however, this will
probably break.

Also, some systems of other local IP addresses than 127.0.0.1 in their
configuration, E.g. some Debian and Ubuntu distributions define the
fixed local hostname as 127.0.1.1. This was added in order to work
around some configuration issues. See
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099 for details.

You should have a look at your /etc/hosts file to check this. Generally
(at least right now), it is always a good idea to specify full IP
addresses instead of hostnames in the HAProxy configuration. As
specified hostnames are resolved only once during startup (in HAProxy
1.5), you are thus save from hard to debug issues stemming from
different opinions about a hostname-ip mapping in DNS and in your
running HAProxy processes.

Regards,
Holger



ha-proxy strange behavior with check localhost option

2015-08-10 Thread bln prasad
Hi,
I configured my backend health check as below and my backed end is
listening on 0.0.0.0:8002
check localhost:8002
I was using haproxy-1.5.11 version and we didn't see any issues. But when i
upgraded to haproxy-1.5.14, i'm finding that same above configuration is
failing on some systems. It started working when i changed to below.
  check 127.0.0.1:8002

I'm not sure why health check is failing if it's localhost on few systems
and this is observed with only 1.5.14 version.
ideally there should not be any difference between localhost and 127.0.0.1
right.

Can you please throw some inputs on this issue.

Thanks  Regards,
BLN