On Sun, Feb 7, 2016 at 9:43 AM, GrĂ¼ninger, Andreas (LGL Extern) <[email protected]> wrote: > Hello folks > > > > Haproxy 1.6.3. > > Compiled in OpenIndiana with kernel from December 2015 (illumos-cbff3ab). > > > > I would like to use an offset for the ports in the server definition. > > > > We have several pairs of message brokers in a master/slave scenario with up > to three instances of the admin console listening on the ports 8161, 8162, > 8163 (prod, test, dev). > > > > What I would like to use is e.g. > > ... > > bind :28161,:28162,:28163 > > ... > > server .... <IPADDRESS OF TARGET>:-20000 > > ... > > > > This does not work because the health checks don't respect the server flag > SRV_F_MAPPORTS. > > This flag is set when during parsing the offset is recognized and used in > backend.c (line 787). > > It should be used in checks.c in connect_conn_chk (line 1421). > > Line numbers are from version 1.6 from the sources found in github. > > > > In the following I use the scenario with 2 instances 8162 and 8163. > > Both instances are running on zd-activemq-s22 and are down on > zd-activemq-s21. > > The first proxy works but the health check uses the wrong instance. > > The health check uses port 8162 and the connection will be made with port > 8163. > > The second proxy does not work at all. > > The health check uses 8161 where no instance is listening. > > No target servers are found and the proxy is not usable. > > > > # cat /opt/etc/haproxy-test.cfg > > global > > maxconn 4096 > > > > defaults > > log global > > mode http > > option dontlog-normal > > retries 3 > > maxconn 2000 > > timeout connect 5000 > > timeout client 50000 > > timeout server 50000 > > > > listen statistics > > bind :1935 > > stats enable > > stats uri /haproxy?stats > > stats auth admin:admin > > > > listen activmq-works > > bind :8162 > > option httpchk HEAD / > > server zd-activemq-s21 10.50.241.93:+1 check > > server zd-activemq-s22 10.50.241.94:+1 check > > > > listen activmq-doesnotwork > > bind :18161 > > option httpchk HEAD / > > server zd-activemq-s21 10.50.241.93:+1 check > > server zd-activemq-s22 10.50.241.94:+1 check > > > > > > # haproxy -f /opt/etc/haproxy-test.cfg > > [WARNING] 037/091117 (29237) : Server activmq-works/zd-activemq-s21 is DOWN, > reason: Layer4 connection problem, info: "Connection refused", check > duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 > requeued, 0 remaining in queue. > > [WARNING] 037/091118 (29237) : Server activmq-doesnotwork/zd-activemq-s21 is > DOWN, reason: Layer4 connection problem, info: "Connection refused", check > duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 > requeued, 0 remaining in queue. > > [WARNING] 037/091118 (29237) : Server activmq-doesnotwork/zd-activemq-s22 is > DOWN, reason: Layer4 connection problem, info: "Connection refused", check > duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 > requeued, 0 remaining in queue. > > [ALERT] 037/091118 (29237) : proxy 'activmq-doesnotwork' has no server > available! > > > > > > > > Regards > > > > Andreas
Hi Andreas, First, there are some inconsistencies between your description and your configuration example. Could you please check and resend your example in case I misunderstood where your problem is? That said, you may want to precise the port you want to check: listen activmq-fix bind :18161 option httpchk HEAD / server zd-activemq-s21 10.50.241.93:+1 check port 8161 server zd-activemq-s22 10.50.241.94:+1 check port 8161 Something important to note, is that HAProxy's behavior is not the same with those 2 configurations: 1: listen example1 bind :18161 option httpchk HEAD / server zd-activemq-s21 10.50.241.93:+1 check server zd-activemq-s22 10.50.241.94:+1 check => bind's port is being used for health checks => If multiple bind are present, the first one is used. 2: frontend f_example2 bind :18161 default_backend b_example2 backend b_example2 option httpchk HEAD / server zd-activemq-s21 10.50.241.93:+1 check server zd-activemq-s22 10.50.241.94:+1 check => this configuration is invalid and an ALERT is returned because backend b_example doesn't know to which TCP port it is supposed to get connected to send the health check. Baptiste

