On Fri, Feb 8, 2019 at 2:29 PM Igor Cicimov <ig...@encompasscorporation.com>
wrote:

> Hi,
>
> I have a Jetty frontend exposed for couple of ActiveMQ servers behind SSL
> terminating Haproxy-1.8.18. They share same storage and state via lock file
> and there is only one active AMQ at any given time. I'm testing this now
> with dynamic backend using Consul DNS resolution:
>
> # dig +short @127.0.0.1 -p 8600 activemq.service.consul
> 10.140.4.122
> 10.140.3.171
>
> # dig +short @127.0.0.1 -p 8600 _activemq._tcp.service.consul SRV
> 1 1 61616 ip-10-140-4-122.node.dc1.consul.
> 1 1 61616 ip-10-140-3-171.node.dc1.consul.
>
> The backends status, the current "master":
>
> root@ip-10-140-3-171:~/configuration-management# netstat -tuplen | grep
> java
> tcp        0      0 0.0.0.0:8161            0.0.0.0:*
> LISTEN      503        13749196    17256/java
> tcp        0      0 0.0.0.0:6161           0.0.0.0:*
> LISTEN      503        13749193    17256/java
>
> and the "slave":
>
> root@ip-10-140-4-122:~# netstat -tuplen | grep java
>
> So the service ports are not available on the second one.
>
> This is the relevant part of the HAP config that I think might be of
> interest:
>
> global
>     server-state-base /var/lib/haproxy
>     server-state-file hap_state
>
> defaults
>     load-server-state-from-file global
>     default-server init-addr    last,libc,none
>
> listen amq
>     bind ... ssl crt ...
>     mode http
>
>     option prefer-last-server
>
>     # when this is on the backend is down
>     #option tcp-check
>
>     default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s
> maxconn 25 maxqueue 256 weight 100
>
>     # working but both show as up
>     server-template amqs 2 activemq.service.consul:8161 check
>
>     # working old static setup
>     #server ip-10-140-3-171 10.140.3.171:8161 check
>     #server ip-10-140-4-122 10.140.4.122:8161 check
>
> This is working but the thing is I see both servers as UP in the HAP
> console:
> [image: amqs.png]
> Is this normal for this kind of setup or I'm doing something wrong?
>
> Another observation, when I have tcp check enabled like:
>
>     option tcp-check
>
> the way I had it with the static lines like:
>
>     server ip-10-140-3-171 10.140.3.171:8161 check
>     server ip-10-140-4-122 10.140.4.122:8161 check
>
> then both servers show as down.
> Thanks in advance for any kind of input.
> Igor
>
> Ok, the state has changed now, I have correct state on one haproxy:

[image: amqs_hap1.png]
but on the second the whole backend is down:

[image: amqs_hap2.png]
I confirmed via telnet that I can connect to port 8161 to the running amq
server from both haproxy servers.

Reply via email to