Hello Adrien,

On Wed, Jun 02, 2010 at 12:19:47PM +0200, Adrien Desprez wrote:
> Hello,
> 
> is it possible to perform different checks according to the server
> destination?

no you can't, but see below.

(...)
> backend www.site.fr
>         mode http
>         log global
>         balance roundrobin
>         cookie CZKLJasD insert indirect nocache
>         option httpclose
>         option httpchk GET /check/check.php HTTP/1.1\r\nHost:\ www.site.fr
>         option forwardfor except 127.0.0.1
>         server main 192.168.1.65:80 cookie main check port 80
>         server bu 192.168.1.66:80 cookie bu check port 80 backup
>         server bmain 192.168.1.65:80 cookie bmain check port 8000 backup
>         server bbu 192.168.1.66:80 cookie bbu check port 8000 backup
> 
> 
> This configuration is working well on my model. But I don't want to
> add another port listening on my Apache on production. Is it possible
> to perform two different checks on the same backend. One for "main"
> and "bu", another for "bmain" and "bbu"?

What you can do is to have two backends with different checks, and
have a switching rule in your frontend to use either one or the other,
depending on the number of available servers in each :

frontend www.site.fr
        use_backend www.site.fr-1 if { nbsrv(www.site.fr-1) gt 0 }
        use_backend www.site.fr-2 if { nbsrv(www.site.fr-2) gt 0 }

backend www.site.fr-1
        mode http
        log global
        balance roundrobin
        cookie CZKLJasD insert indirect nocache
        option httpclose
        option forwardfor except 127.0.0.1
        option httpchk GET /check/check_database_and_apache.php 
HTTP/1.1\r\nHost:\ www.site.fr
        server main 192.168.1.65:80 cookie main check port 80
        server bu 192.168.1.66:80 cookie bu check port 80 backup

backend www.site.fr-2
        mode http
        log global
        balance roundrobin
        cookie CZKLJasD insert indirect nocache
        option httpclose
        option forwardfor except 127.0.0.1
        option httpchk GET /check/check_apache.php HTTP/1.1\r\nHost:\ 
www.site.fr
        server bmain 192.168.1.65:80 cookie bmain check port 80 backup
        server bbu 192.168.1.66:80 cookie bbu check port 80 backup

Regards,
Willy


Reply via email to