HttpHealthcheckModule server not marked down

liseen liseen.wan at gmail.com
Mon Oct 3 17:53:13 UTC 2011


Hi, sjaak

On Mon, Oct 3, 2011 at 10:39 PM, Sjaak Pieterse <sjaak23 at gmail.com> wrote:

> Hey Liseen,
>
> Thank you for teh fix, it's working now for standard round robin, for
> upstream_hash it's not working but that's no problem for us we are not
> using that in production.
>
The fail test also add one time to hash_again.  Can you set hash_again
10(greater  than or equal servers's number), try again and  tell me the
result?   The upstream_hash module  has  worked  for some time.

what we often use is gnosek-nginx-upstream-fair, to make it work with
> that, can you tell how to handle?
>
Patch the upstream-fair module like round_robin and upstream_hash module.

Maybe these should be a module that contains all of the following features:
 RR, Hash, Fair, Health check.  Hope some body will provide such module. I
don't like patching code.


>
>
>
> this is what i've done to make it work for now:
>
> peckhardt at test-nginx:~/nginx-1.0.6$ patch -p1 <
> ../liseen-healthcheck_nginx_upstreams-17298cf/healthcheck.patch
> patching file src/http/ngx_http_upstream.c
> Hunk #1 succeeded at 4270 (offset 11 lines).
> patching file src/http/ngx_http_upstream.h
> patching file src/http/ngx_http_upstream_round_robin.c
> Hunk #2 succeeded at 25 with fuzz 2 (offset 9 lines).
> Hunk #3 succeeded at 33 (offset 9 lines).
> Hunk #4 succeeded at 68 (offset 9 lines).
> Hunk #5 succeeded at 416 (offset 7 lines).
> Hunk #6 succeeded at 448 (offset 7 lines).
> Hunk #7 succeeded at 465 (offset 7 lines).
> Hunk #8 succeeded at 506 (offset 7 lines).
> Hunk #9 succeeded at 523 (offset 7 lines).
> Hunk #10 succeeded at 617 (offset 7 lines).
> patching file src/http/ngx_http_upstream_round_robin.h
>
> peckhardt at test-nginx:~/nginx-1.0.6$sudo ./configure
> --with-http_ssl_module
> --add-module=/home/peckhardt/gnosek-nginx-upstream-fair-2131c73
> --with-http_stub_status_module
> --add-module=/home/peckhardt/liseen-healthcheck_nginx_upstreams-17298cf
> --add-module=/home/peckhardt/liseen-nginx_upstream_hash-43fab03
> --prefix=/usr/local/nginx-1.0.6 --with-debug
>
> peckhardt at test-nginx:~/nginx-1.0.6$sudo su
> peckhardt at test-nginx:~/nginx-1.0.6$make install clean
>
> nginx config:
> ########### test healthcheck ######
>    upstream www-health{
>        server 213.154.235.185 ;
>        server 213.136.14.13 ;
>    #hash $request_uri;
>    #hash_again 1;
>     healthcheck_enabled;
>    healthcheck_delay 10000 ;
>    healthcheck_timeout 1000;
>    healthcheck_failcount 2;
>    #healthcheck_expected 'I_AM_ALIVE';
>    #Important: HTTP/1.0
>     healthcheck_send "GET / HTTP/1.0" 'Host: health.test.x.com';
>    }
>
>
>
> 2011/10/1 liseen <liseen.wan at gmail.com>:
> > Hi,
> >
> > On Sat, Oct 1, 2011 at 7:16 AM, liseen <liseen.wan at gmail.com> wrote:
> >>
> >> Hi,
> >> Please try:
> >>
> >>
> https://github.com/liseen/healthcheck_nginx_upstreams/blob/master/healthcheck.patch
> >> patch -p1 < healthcheck.patch
> >> ./configure ....
> >> if you use healthcheck with upstream hash, please compile with branch
> >> support_http_healthchecks of cep21's fork
> >>
> >>
> https://github.com/cep21/nginx_upstream_hash/tree/support_http_healthchecks
> >
> > if all upstreams' backends are down(healthcheck),  cep's upstream_hash
> will
> > ignore Healthcheck,  if it is not you need, Please try:
> >   https://github.com/liseen/nginx_upstream_hash
> > If you find something wrong,  please open an issue on github. thanks.
> >
> > liseen
> >
> >>
> >>
> >>
> >> liseen
> >>
> >>
> >> On Sat, Oct 1, 2011 at 6:06 AM, liseen <liseen.wan at gmail.com> wrote:
> >>>
> >>> Hi,
> >>> It is a bug.
> >>> the ngx_upstream_get_peer only check the index greater than i;  forgot
> to
> >>> check i itself.
> >>> I used my nginx patch for healthcheck,  I have used it in production
> more
> >>> than half a year. I will upload it to my github in some hours.
> >>> liseen
> >>> On Fri, Sep 23, 2011 at 4:34 AM, Sjaak Pieterse <sjaak23 at gmail.com>
> >>> wrote:
> >>>>
> >>>> Hi there,
> >>>>
> >>>> i'm trying to use the HttpHealthcheckModule for nginx, but i have some
> >>>> troubles with it.
> >>>>
> >>>> i have two servers in my upstream, when sabotaging the health for one
> >>>> server i see in the status view of healthcheck that the server is
> >>>> down(1), but if i go to the website i'm checking i still come out on
> >>>> it and see a broken page.
> >>>>
> >>>> how can i arrange that the server automatically is marked as down when
> >>>> the check fails?
> >>>>
> >>>> sorry for my bad english and maybe noob questions.
> >>>>
> >>>> config:
> >>>>  upstream www-health{
> >>>>         server x.x.x.1 ;
> >>>>         server x.x.x.2 ;
> >>>>     healthcheck_enabled;
> >>>>     healthcheck_delay 10000 ;
> >>>>     healthcheck_timeout 1000;
> >>>>     healthcheck_failcount 2;
> >>>>     #healthcheck_expected 'I_AM_ALIVE';
> >>>>     #Important: HTTP/1.0
> >>>>     healthcheck_send "GET / HTTP/1.0" 'Host: health.test.x.com'
> >>>> 'Conection: close' ;
> >>>> }
> >>>>
> >>>> nginx: nginx version: nginx/1.0.6
> >>>> nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
> >>>> nginx: TLS SNI support enabled
> >>>> nginx: configure arguments: --with-http_ssl_module
> >>>> --add-module=/gnosek-nginx-upstream-fair-2131c73
> >>>> --with-http_stub_status_module
> >>>> --add-module=/cep21-healthcheck_nginx_upstreams-b33a846
> >>>> --prefix=/usr/local/nginx-1.0.6 --with-debug
> >>>>
> >>>> used:
> >>>> peckhardt at test-nginx:~/nginx-1.0.6$patch -p1 <
> >>>> /cep21-healthcheck_nginx_upstreams-5fa4bff/nginx.patch
> >>>>
> >>>> hope someone would help me.
> >>>>
> >>>> greetings
> >>>>
> >>>> _______________________________________________
> >>>> nginx mailing list
> >>>> nginx at nginx.org
> >>>> http://mailman.nginx.org/mailman/listinfo/nginx
> >>>
> >>
> >
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
> >
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20111004/2e5ef446/attachment-0001.html>


More information about the nginx mailing list