wget http://www.rabbitmq.com/releases/erlang/erlang-18.1-1.el6.x86_64.rpm
rpm -ihv erlang-18.1-1.el6.x86_64.rpm
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.7/rabbitmq-server-generic-unix-3.5.7.tar.gz
tar xzf rabbitmq-server-generic-unix-3.5.7.tar.gz
mv rabbitmq_server-3.5.7 rabbitmq
./rabbitmq/sbin/rabbitmq-server &
chmod 600 /root/.erlang.cookie
vim /root/.erlang.cookie
chmod 400 /root/.erlang.cookie
HMIDWHVQSSFMFRQNIEVH
reboot
./rabbitmq/sbin/rabbitmq-server &
./rabbitmq/sbin/rabbitmqctl stop_app
./rabbitmq/sbin/rabbitmqctl join_cluster rabbit@rabbit1
./rabbitmq/sbin/rabbitmqctl start_app
./rabbitmq/sbin/rabbitmqctl set_policy -p lsy ha-all "^\." '{"ha-mode":"all"}'
yum install haproxy
vim /etc/haproxy/haproxy.cfg
### haproxy 监控页面地址是:http://192.168.68.131:9188/haproxy_status
listen admin_stats
bind *:9188
mode http
log 127.0.0.1 local3 err
stats refresh 60s
stats uri /haproxy_status
stats realm welcome login\ Haproxy
stats auth admin:123456
stats hide-version
stats admin if TRUE
### rabbitmq 集群配置,转发到
listen rabbitmq_cluster
bind *:5672
mode tcp
balance roundrobin
server rabbitnode1 192.168.68.128:5672 check inter 2000 rise 2 fall 3 weight 1
server rabbitnode2 192.168.68.129:5672 check inter 2000 rise 2 fall 3 weight 1
server rabbitnode3 192.168.68.130:5672 check inter 2000 rise 2 fall 3 weight 1