RabbitMQ Cluster

Installation
# 1. copy over all nodes from first
/var/lib/rabbitmq/.erlang.cookie

# 2. remove from prev clusters (all nodes) if needed
rabbitmq-server -detached

# 3. node 2-to-N
rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@rmq1
rabbitmqctl start_app

# 4. check
rabbitmqctl cluster_status
rabbitmqctl eval "net_adm:ping(rabbit@rmq1)."

# 5. add users
rabbitmqctl add_user admin P@ssw0rd
rabbitmqctl set_user_tags admin Administrators
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

# delete node from cluster
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl start_app

# remote remove of node
rabbitmqctl forget_cluster_node rabbit@rabbit1

HAproxy
global
    daemon

defaults
    maxconn 10000
    retries 3
    timeout connect 10s

listen rabbitmq-cluster
    bind *:5672
    mode tcp    
    option clitcpka
    option tcplog
    option persist
    option redispatch
    timeout client 3h
    timeout server 3h    
//    balance leastconn
    balance roundrobin
    server rmq1 10.10.0.11:5672 check inter 2000 rise 2 fall 3
    server rmq2 10.10.0.12:5672 check inter 2000 rise 2 fall 3
    server rmq3 10.10.0.13:5672 check inter 2000 rise 2 fall 3

listen stats :8080
    mode http
    stats enable
    stats hide-version
    stats uri /