Re: HAProxy Healthcheck issue using Virtual hostname

2018-05-04 Thread Igor Cicimov
On Fri, May 4, 2018 at 5:01 PM, Lukas Tribus  wrote:

> Hello Igor, Sen,
>
>
> On 4 May 2018 at 08:46, Igor Cicimov 
> wrote:
> > Have you tried:
> >
> > option httpchk GET /env HTTP/1.1\r\nHost:\ %[req.hdr(Host)]
>
> When you are health checking, you don't have a Host header as you
> don't have a frontend connection associated to it.
>
>
> I proposed to offload healthcheck to dedicated backends and track them
> from the main backend here:
>
> https://discourse.haproxy.org/t/helathcheck-on-multiple-
> backends-with-virtual-hostnames/2413/12
>
>
> Just not quite clear about how host headers from actual clients should
> look like ...
>
>
> cheers,
> lukas
>

​Of course, nice and elegant solution. Didn't think of 'track' and now that
you mentioned it I'm sure I'm using it myself somewhere on couple of
proxies but can't even remember where :-/

​Igor​


Re: HAProxy Healthcheck issue using Virtual hostname

2018-05-04 Thread Lukas Tribus
Hello Igor, Sen,


On 4 May 2018 at 08:46, Igor Cicimov  wrote:
> Have you tried:
>
> option httpchk GET /env HTTP/1.1\r\nHost:\ %[req.hdr(Host)]

When you are health checking, you don't have a Host header as you
don't have a frontend connection associated to it.


I proposed to offload healthcheck to dedicated backends and track them
from the main backend here:

https://discourse.haproxy.org/t/helathcheck-on-multiple-backends-with-virtual-hostnames/2413/12


Just not quite clear about how host headers from actual clients should
look like ...


cheers,
lukas



Re: HAProxy Healthcheck issue using Virtual hostname

2018-05-04 Thread Igor Cicimov
Hi,

On Fri, Apr 27, 2018 at 3:03 PM, Sen  wrote:

> Hi
>
> I have an app deployed in Pivotal Cloudfoundry (PCF) and to route traffic
> to an app in PCF, we have to use application route name (virtual hostname).
>
> We have PCF in two different datacenters and I need to load balance the
> traffic to these DCs , but I'm having the challenge in checking the health
> of the application.
>
> here is the config - when i have app deployed only in one DC:
>
> backend CustomerLookupService.searchCustomer
> mode http
> balance roundrobin
> ​​
> option httpchk GET /env HTTP/1.1\r\nHost:\ customerloo
> kup.xxx.px-prd02.cf..com:443
> ​​
> \r\n
> http-check expect rstatus ^200
> option httplog
> timeout server 60s
> default-server inter 10s fall 3 rise 2
> server s_CustomerLookupService.searchCustomer2 customerlookup
> .xxx.px-prd02.cf..com:443 check resolvers dns ssl verify none
>
>
> Now I need to route the traffic to " customerlookup.xxx.px-prd03.
> cf..com:443  " ,
> in addition to " customerlookup.xxx.px-prd02.cf..com:443 ".
>
> in that case, how do I check the health of prd02 and prd03?.
>
> I tried following - but it's not working:
>
> backend CustomerLookupService.searchCustomer
> mode http
> balance roundrobin
>
> option forwardfor
>
> http-send-name-header Host
> option httpchk GET /env HTTP/1.1
> http-check expect rstatus ^200
> option httplog
> timeout server 60s
> default-server inter 10s fall 3 rise 2
> server s_CustomerLookupService.searchCustomer2 customerlookup
> .xxx.px-prd02.cf..com:443 check resolvers dns ssl verify none
> server s_CustomerLookupService.searchCustomer3 customerlookup
> .xxx.px-prd03.cf..com:443
>  check resolvers dns
> ssl verify none
>
> Looks like, Hostname is not getting passed in healthcheck calls.
>
>
​Have you tried:

​
option httpchk GET /env HTTP/1.1\r\nHost:\ %[req.hdr(Host)]
​
\r\n
​

> Any ideas how to solve this problem?
>
> Thanks in advance
> Sen.
>


Re: HAProxy Healthcheck issue using Virtual hostname

2018-05-03 Thread Sen
Hi

I have an app deployed in Pivotal Cloudfoundry (PCF) and to route traffic
to an app in PCF, we have to use application route name (virtual hostname).

We have PCF in two different datacenters and I need to load balance the
traffic to these DCs , but I'm having the challenge in checking the health
of the application.

here is the config - when i have app deployed only in one DC:

backend CustomerLookupService.searchCustomer
mode http
balance roundrobin
option httpchk GET /env
HTTP/1.1\r\nHost:\customerlookup.xxx.px-prd02.cf..com:443\r\n
http-check expect rstatus ^200
option httplog
timeout server 60s
default-server inter 10s fall 3 rise 2
server 
s_CustomerLookupService.searchCustomer2customerlookup.xxx.px-prd02.cf..com:443
check resolvers dns ssl verify
none


Now I need to route the traffic to "customerlookup.xxx.px-prd03.cf..com:443
 " , in addition
to "customerlookup.xxx.px-prd02.cf..com:443 ".

in that case, how do I check the health of prd02 and prd03?.

I tried following - but it's not working:

backend CustomerLookupService.searchCustomer
mode http
balance roundrobin

option forwardfor

http-send-name-header Host
option httpchk GET /env HTTP/1.1
http-check expect rstatus ^200
option httplog
timeout server 60s
default-server inter 10s fall 3 rise 2
server 
s_CustomerLookupService.searchCustomer2customerlookup.xxx.px-prd02.cf..com:443
check resolvers dns ssl verify
none
server 
s_CustomerLookupService.searchCustomer3customerlookup.xxx.px-prd03.cf..com:443
 check resolvers dns
ssl verify none

Looks like, Hostname is not getting passed in healthcheck calls.

Any ideas how to solve this problem?

Thanks in advance
Sen.


On Thu, Apr 26, 2018 at 10:03 PM, Sen  wrote:

> Hi
>
> I have an app deployed in Pivotal Cloudfoundry (PCF) and to route traffic
> to an app in PCF, we have to use application route name (virtual hostname).
>
> We have PCF in two different datacenters and I need to load balance the
> traffic to these DCs , but I'm having the challenge in checking the health
> of the application.
>
> here is the config - when i have app deployed only in one DC:
>
> backend CustomerLookupService.searchCustomer
> mode http
> balance roundrobin
> option httpchk GET /env HTTP/1.1\r\nHost:\ customerloo
> kup.xxx.px-prd02.cf..com:443\r\n
> http-check expect rstatus ^200
> option httplog
> timeout server 60s
> default-server inter 10s fall 3 rise 2
> server s_CustomerLookupService.searchCustomer2 customerlookup
> .xxx.px-prd02.cf..com:443 check resolvers dns ssl verify none
>
>
> Now I need to route the traffic to " customerlookup.xxx.px-prd03.
> cf..com:443  " ,
> in addition to " customerlookup.xxx.px-prd02.cf..com:443 ".
>
> in that case, how do I check the health of prd02 and prd03?.
>
> I tried following - but it's not working:
>
> backend CustomerLookupService.searchCustomer
> mode http
> balance roundrobin
>
> option forwardfor
>
> http-send-name-header Host
> option httpchk GET /env HTTP/1.1
> http-check expect rstatus ^200
> option httplog
> timeout server 60s
> default-server inter 10s fall 3 rise 2
> server s_CustomerLookupService.searchCustomer2 customerlookup
> .xxx.px-prd02.cf..com:443 check resolvers dns ssl verify none
> server s_CustomerLookupService.searchCustomer3 customerlookup
> .xxx.px-prd03.cf..com:443
>  check resolvers dns
> ssl verify none
>
> Looks like, Hostname is not getting passed in healthcheck calls.
>
> Any ideas how to solve this problem?
>
> Thanks in advance
> Sen.
>
>
>


-- 
-Sen


HAProxy Healthcheck issue using Virtual hostname

2018-04-26 Thread Sen
Hi

I have an app deployed in Pivotal Cloudfoundry (PCF) and to route traffic
to an app in PCF, we have to use application route name (virtual hostname).

We have PCF in two different datacenters and I need to load balance the
traffic to these DCs , but I'm having the challenge in checking the health
of the application.

here is the config - when i have app deployed only in one DC:

backend CustomerLookupService.searchCustomer
mode http
balance roundrobin
option httpchk GET /env HTTP/1.1\r\nHost:\
customerlookup.xxx.px-prd02.cf..com:443\r\n
http-check expect rstatus ^200
option httplog
timeout server 60s
default-server inter 10s fall 3 rise 2
server s_CustomerLookupService.searchCustomer2
customerlookup.xxx.px-prd02.cf..com:443 check resolvers dns ssl verify
none


Now I need to route the traffic to "
customerlookup.xxx.px-prd03.cf..com:443
 " , in addition to "
customerlookup.xxx.px-prd02.cf..com:443 ".

in that case, how do I check the health of prd02 and prd03?.

I tried following - but it's not working:

backend CustomerLookupService.searchCustomer
mode http
balance roundrobin

option forwardfor

http-send-name-header Host
option httpchk GET /env HTTP/1.1
http-check expect rstatus ^200
option httplog
timeout server 60s
default-server inter 10s fall 3 rise 2
server s_CustomerLookupService.searchCustomer2
customerlookup.xxx.px-prd02.cf..com:443 check resolvers dns ssl verify
none
server s_CustomerLookupService.searchCustomer3
customerlookup.xxx.px-prd03.cf..com:443
 check resolvers dns
ssl verify none

Looks like, Hostname is not getting passed in healthcheck calls.

Any ideas how to solve this problem?

Thanks in advance
Sen.