Hi Igor,

On Mon, Jun 13, 2011 at 02:25:54AM +0800, Igor wrote:
> Hi, all.
> 
> I got 2 squid forward proxies, and just want to use haproxy to do load
> balance and healthy monitoring.
> I got basic backend conf like:
> 
>   balance roundrobin
>         server  squid1  127.0.0.1:999
>         server squid2  127.0.0.1:998
> 
> but what's the best and smart way to config haproxy to do healthy
> check to make the high availability of the proxy server?

The right thing to do is to make a request pass through squid. In
your case, since both are on the same machine, you could have haproxy
serve a basic content that it can access through squid, something in
this vein :

listen check-responder
        bind :990
        mode http
        monitor-uri /

listen squid-lb
        balance roundrobin
        server squid1  127.0.0.1:999 check
        server squid2  127.0.0.1:998 check
        option httpchk GET http://127.0.0.1:990/ HTTP/1.0

That way, haproxy connects to squid which forwards the request to haproxy.
If this works, an HTTP 200 response is sent back via squid, which haproxy
can detect to ensure the service is OK.

Regards,
Willy


Reply via email to