Re: New to HAproxy - how to define custom health-check msg?

2009-05-22 Thread Willy Tarreau
On Fri, May 22, 2009 at 09:34:39PM +0530, Sanjeev Kumar wrote:
> Newbie question:
> 
> In response to http-health-chk string: "HEAD /index.html HTTP/1.0" ,
> if my server responds responds with only one line:
> "HTTP/1.0 200 OK " , will the health will be accepted ok.
> (HAproxy in not accepting this health-response in my setup).
> 
> Does the health-chk response needs to be complete set of headers ??

Please recheck your script's output, as haproxy only verifies HTTP/1.0 and
the first character of the status code (2 here), and is OK with that reply.
So surely there is something odd.

Regards,
Willy




Re: New to HAproxy - how to define custom health-check msg?

2009-05-22 Thread Sanjeev Kumar
Newbie question:

In response to http-health-chk string: "HEAD /index.html HTTP/1.0" ,
if my server responds responds with only one line:
"HTTP/1.0 200 OK " , will the health will be accepted ok.
(HAproxy in not accepting this health-response in my setup).

Does the health-chk response needs to be complete set of headers ??

Date:
Server:
content-type:
content-length
...
...


On Fri, May 22, 2009 at 7:37 AM, Sanjeev Kumar wrote:

> Need clarification on using 2nd port for http health-check.
> If I define my config as my App to serve port-999  and respond to
> Http-healthChk on port-81:
>
> ...
> listen  192.168.1.2: 999
> mode http
> option httpchk
> server servA 192.168.1.4:999  check  port  81
>  server servB 192.168.1.5:999  check  port  81 backup
> 
>
> Will this work ? Does it require any kind of configuration on server side?
>
> thanks,
> -sanjeev kumar
>   On Sun, May 17, 2009 at 1:11 PM, Willy Tarreau  wrote:
>
>> Hi,
>>
>> On Fri, May 15, 2009 at 10:51:20AM -0400, John Lauro wrote:
>> > I think there might be a better way, but you could run the check against
>> a
>> > different port.  On that other port, you could have it run your custom
>> check
>> > and return an OK response if your check passes and fail if it doesn't.
>>
>> That's generally what is done. However, I'd like to point out that a
>> patch has been proposed to implement explicit content validation (ECV)
>> on HTTP but it should be easily adapted to non-HTTP services. I've not
>> merged it right now because it needs some fixing (risks of segfault if
>> the server does not return a content length or returns an incorrect one).
>>
>> That said, we need a more generic health-check framework. Many people are
>> asking for send/expect, others for lists of rotating URLs, others for an
>> easier ability to send headers. We should put all that down and try to
>> find how to implement something better.
>>
>> Regards,
>> Willy
>>
>>
>


Re: New to HAproxy - how to define custom health-check msg?

2009-05-21 Thread Sanjeev Kumar
Need clarification on using 2nd port for http health-check.
If I define my config as my App to serve port-999  and respond to
Http-healthChk on port-81:

...
listen  192.168.1.2: 999
mode http
option httpchk
server servA 192.168.1.4:999  check  port  81
 server servA 192.168.1.5:999  check  port  81 backup


Will this work ? Does it require any kind of configuration on server side?

thanks,
-sanjeev kumar
On Sun, May 17, 2009 at 1:11 PM, Willy Tarreau  wrote:

> Hi,
>
> On Fri, May 15, 2009 at 10:51:20AM -0400, John Lauro wrote:
> > I think there might be a better way, but you could run the check against
> a
> > different port.  On that other port, you could have it run your custom
> check
> > and return an OK response if your check passes and fail if it doesn't.
>
> That's generally what is done. However, I'd like to point out that a
> patch has been proposed to implement explicit content validation (ECV)
> on HTTP but it should be easily adapted to non-HTTP services. I've not
> merged it right now because it needs some fixing (risks of segfault if
> the server does not return a content length or returns an incorrect one).
>
> That said, we need a more generic health-check framework. Many people are
> asking for send/expect, others for lists of rotating URLs, others for an
> easier ability to send headers. We should put all that down and try to
> find how to implement something better.
>
> Regards,
> Willy
>
>


Re: New to HAproxy - how to define custom health-check msg?

2009-05-17 Thread Willy Tarreau
Hi,

On Fri, May 15, 2009 at 10:51:20AM -0400, John Lauro wrote:
> I think there might be a better way, but you could run the check against a
> different port.  On that other port, you could have it run your custom check
> and return an OK response if your check passes and fail if it doesn't.

That's generally what is done. However, I'd like to point out that a
patch has been proposed to implement explicit content validation (ECV)
on HTTP but it should be easily adapted to non-HTTP services. I've not
merged it right now because it needs some fixing (risks of segfault if
the server does not return a content length or returns an incorrect one).

That said, we need a more generic health-check framework. Many people are
asking for send/expect, others for lists of rotating URLs, others for an
easier ability to send headers. We should put all that down and try to
find how to implement something better.

Regards,
Willy




RE: New to HAproxy - how to define custom health-check msg?

2009-05-15 Thread John Lauro
I think there might be a better way, but you could run the check against a
different port.  On that other port, you could have it run your custom check
and return an OK response if your check passes and fail if it doesn't.

 

 

 

From: Sanjeev Kumar [mailto:replysku...@gmail.com] 
Sent: Friday, May 15, 2009 10:26 AM
To: haproxy@formilux.org
Subject: Re: New to HAproxy - how to define custom health-check msg?

 

 

Hi,

 

I am planning to use HAproxy to load-balance my custom-service(Tcp
Application) on Real-servers.

My service is not Http-based, hence option 'httpchk' would be not be replied
by my App.

Just checking TCP-connection open is not sufficient.

 

How can I define my custom "send-string" and "expected-string" using
HA-proxy ??

 

Any direction/pointers would be highly appreciated.

 

-Sanjeev kumar

 

Internal Virus Database is out of date.
Checked by AVG - www.avg.com
Version: 8.5.325 / Virus Database: 270.12.21/2101 - Release Date: 05/06/09
17:58:00



Re: New to HAproxy - how to define custom health-check msg?

2009-05-15 Thread Sanjeev Kumar
> Hi,
>
> I am planning to use HAproxy to load-balance my custom-service(Tcp
> Application) on Real-servers.
> My service is not Http-based, hence option 'httpchk' would be not be
> replied by my App.
> Just checking TCP-connection open is not sufficient.
>
> How can I define my custom "send-string" and "expected-string" using
> HA-proxy ??
>
> Any direction/pointers would be highly appreciated.
>
> -Sanjeev kumar
>