Re: backend using check of another backend

From: Cyril Bonté <cyril.bonte#free.fr>
Date: Thu, 21 Oct 2010 18:45:59 +0200


Hi Aurélien,
Le jeudi 21 octobre 2010 10:47:50, Aurélien Bras a écrit :
> Hi,
>
> Is it possible to configure haproxy with some backend using check of only
> one backend ? My problem is that all my backend is hosted on same servers
> but need differents backend to apply some quotas. If I enable check on all
> my backend I send too many checks to the network.

See the "track" keyword in the documentation, it exactly answers to your need ;-)

> Somethink like that :
>
> backend b_mysitetocheck
> server server1 check maxconn 100 maxqueue 1
> server server2 check maxconn 100 maxqueue 1
> server server3 check maxconn 100 maxqueue 1
>
> And for others backends without the check :
>
> backend b_othersiteXXX
> server server1 maxconn 100 maxqueue 1 # if server1 active
> on b_mysitetocheck
> server server2 maxconn 100 maxqueue 1 # if server2 active
> on b_mysitetocheck
> server server3 maxconn 100 maxqueue 1 # if server3 active
> on b_mysitetocheck

Which can be written as :
backend b_othersiteXXX

    server server1 <ip>:<port> maxconn 100 maxqueue 1  track b_mysitetocheck/server1
    server server2 <ip>:<port> maxconn 100 maxqueue 1  track b_mysitetocheck/server3
    server server3 <ip>:<port> maxconn 100 maxqueue 1  track b_mysitetocheck/server3

-- 
Cyril Bonté
Received on 2010/10/21 18:45

This archive was generated by hypermail 2.2.0 : 2010/10/21 19:00 CEST