[rabbitmq-discuss] Recommended haproxy config

Dave Curylo curylod at asme.org
Thu Nov 1 19:48:32 GMT 2012


I am running an active-active RabbitMQ cluster, and as recommended by "High
Availability in RabbitMQ: solving part of the puzzle" (
http://www.rabbitmq.com/blog/2011/10/25/high-availability-in-rabbitmq-solving-part-of-the-puzzle/),
I'm connecting to the cluster of message brokers via an haproxy load
balancer.  Everything was working fine until one of the nodes failed, after
which it seemed that the haproxy load balancer did not appear to detect the
failed node.  Clients would initiate connections and often just hang, I
assume because the load balancer is forwarding them on to the failed node.
 As a workaround, I've reconfigured clients to connect directly to a
working node, and everything returned to normal, so I am suspecting my
haproxy configuration is not correct.

Does anyone have experience using haproxy as a load balancer for RabbitMQ,
and if so, can you share your config or take a look at my configuration and
let me know if you have any recommendations?

haproxy.cfg:
global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        maxconn 4096
        user haproxy
        group haproxy
        daemon

defaults
        log     global
        mode    http
        option  dontlognull
        retries 3
        option redispatch
        maxconn 2000
        contimeout      5000
        clitimeout      50000
        srvtimeout      50000

listen rabbitmq 0.0.0.0:5672
        mode tcp
        stats enable
        balance roundrobin
        option forwardfor
        option tcpka
        server rabbit01 1.2.3.4:5672 check inter 5000
        server rabbit02 1.2.3.5:5672 check inter 5000
        server rabbit03 1.2.3.6:5672 check inter 5000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121101/407ada55/attachment.htm>


More information about the rabbitmq-discuss mailing list