Use lua setting a server port

2020-04-13 Thread io Sen
we have a function to setting server ip address : set_addr
and we have a function to query server ip address and server port now : get_addr
but not have a setting server port function ,
Is it possible for set_addr to support setting ports?
like this:
set_addr(ip,port)
or
set_port(8443)


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
<http://customerlookup.xxx.px-prd02.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
<http://customerlookup.xxx.px-prd02.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 <senat...@gmail.com> 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 <http://customerlookup.xxx.px-prd02.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
> <http://customerlookup.xxx.px-prd02.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
<http://customerlookup.xxx.px-prd02.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
<http://customerlookup.xxx.px-prd02.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.