Hi Jarno,

Even after updating to GET it is still failing:

[Dec 19 06:12:41]  Health check for server bk_8093_read/primary8093r failed, 
reason: Layer7 timeout, check duration: 2001ms, status: 0/2 DOWN.
[Dec 19 06:12:44]  Health check for server bk_8093_read/primary8093r failed, 
reason: Layer7 wrong status, code: 400, info: "No Host", check duration: 769ms, 
status: 0/2 DOWN.
[Dec 19 06:49:30]  Health check for server bk_8089/primary8089 succeeded, 
reason: Layer4 check passed, check duration: 0ms, status: 3/3 UP.
[Dec 19 06:49:31]  Health check for server bk_5100_read/primary5100r failed, 
reason: Layer7 wrong status, code: 400, info: "No Host", check duration: 379ms, 
status: 0/2 DOWN.
[Dec 19 06:49:31]  Health check for backup server bk_5100_read/backUp05100r 
failed, reason: Layer7 wrong status, code: 400, info: "No Host", check 
duration: 105ms, status: 0/2 DOWN.
[Dec 19 06:51:32]  Health check for server bk_8089/primary8089 succeeded, 
reason: Layer4 check passed, check duration: 0ms, status: 3/3 UP.
[Dec 19 06:51:32]  Health check for server bk_8093_read/primary8093r failed, 
reason: Layer7 wrong status, code: 400, info: "No Host", check duration: 124ms, 
status: 0/2 DOWN.
[Dec 19 06:51:33]  Health check for backup server bk_8093_read/backUp08093r 
failed, reason: Layer7 wrong status, code: 400, info: "No Host", check 
duration: 1ms, status: 0/2 DOWN.
[Dec 19 06:51:33]  Health check for backup server bk_8093_read/backUp18093r 
failed, reason: Layer4 connection problem, info: "Connection refused", check 
duration: 63ms, status: 0/2 DOWN.
[Dec 19 06:51:33]  Health check for server bk_8093_write/primary8093w failed, 
reason: Layer7 invalid response, info: "<15><03><03>", check duration: 128ms, 
status: 0/2 DOWN.
[Dec 19 06:51:34]  Health check for server bk_5100_read/primary5100r failed, 
reason: Layer7 wrong status, code: 400, info: "No Host", check duration: 269ms, 
status: 0/2 DOWN.
[Dec 19 06:51:34]  Health check for backup server bk_5100_read/backUp05100r 
failed, reason: Layer7 wrong status, code: 400, info: "No Host", check 
duration: 20ms, status: 0/2 DOWN.
[haproxy@zld05596 etc]$


backend bk_8093_read
    balance    source
    http-response set-header X-Server %s
    option log-health-checks
    option httpchk GET 
/nexus/v1/repository/rawcentral/com.att.swm.attpublic/healthcheck.txt 
HTTP/1.1\r\nAuthorization:\ Basic\ <auth>
    server primary8093r <serv1>:8093 check verify none
    server backUp08093r <serv2>:8093 check backup verify none 
    server backUp18093r <serv3>:8093 check backup verify none

also wanted to find out if the same option httpchk will work for https?

frontend http-5100
    bind *:5100 ssl crt <cert>.pem
    option httplog
    capture request header Host len 24
    acl is_get  method GET
    use_backend bk_5100_read  if is_get



backend bk_5100_read
    balance    source
    http-response set-header X-Server %s
    option log-health-checks
    option httpchk GET /v1/_ping HTTP/1.1\r\nAuthorization:\ Basic\ <auth>
    server primary5100r <serv1>:5100 ssl check verify none 
    server backUp05100r <serv2>:5100 ssl check backup verify none

Thanks,
Praveen.
-----Original Message-----
From: Jarno Huuskonen [mailto:jarno.huusko...@uef.fi] 
Sent: Wednesday, December 19, 2018 1:05 AM
To: UPPALAPATI, PRAVEEN <pu5...@att.com>
Cc: haproxy@formilux.org; SIVANANDHAM, THANIGAIVEL <ts6...@att.com>
Subject: Re: Http HealthCheck Issue

Hi,

On Tue, Dec 18, UPPALAPATI, PRAVEEN wrote:
> My backend config is:
> 
> backend bk_8093_read
>     balance    source
>     http-response set-header X-Server %s
>     option log-health-checks
>     option httpchk get 
> /nexus/v1/repository/rawcentral/com.att.swm.attpublic/healthcheck.txt 
> HTTP/1.1\r\nAuthorization:\ Basic\ <auth>

Change get to GET, at least apache, ngingx and tomcat expect GET not get.
Or test with for example netcat that your server1 accepts get.

Something like: nc server1.add.re.ss 8093
get /nexus/v1/repository/rawcentral/com.att.swm.attpublic/healthcheck.txt 
HTTP/1.1
Host: ...
Authorization: Basic ...

>     server primary8093r <server1>:8093 check verify none
>     server backUp08093r <server2>::8093 check backup verify none
>     server backUp18093r <server3>::8093 check backup verify none
> 
> Output of log:
> 
> [Dec 18 05:22:51]  Health check for server bk_8093_read/primary8093r failed, 
> reason: Layer7 wrong status, code: 400, info: "No Host", check duration: 
> 543ms, status: 0/2 DOWN.

Like Jonathan said "No Host" is telling you what's wrong.
(HTTP/1.1 requests expect Host: header).

-Jarno

-- 
Jarno Huuskonen

Reply via email to