haproxy.cfg
Dockerfile
docker-compose.yml
docker build -t haproxy-server .
docker-compose -f docker-compose.yml up
docker exec -ti rabbitmq-node-2 bash -c "rabbitmqctl stop_app"
docker exec -ti rabbitmq-node-3 bash -c "rabbitmqctl stop_app"
docker exec -ti rabbitmq-node-2 bash -c "rabbitmqctl join_cluster rabbit@rabbitmq-node-1"
docker exec -ti rabbitmq-node-3 bash -c "rabbitmqctl join_cluster rabbit@rabbitmq-node-1"
docker exec -ti rabbitmq-node-2 bash -c "rabbitmqctl start_app"
docker exec -ti rabbitmq-node-3 bash -c "rabbitmqctl start_app"
Access HAProxy statistics report at http://localhost:1936/haproxy?stats with the credential haproxy:haproxy, and the RabbitMQ console at http://localhost:15672/# with the credential root:1234567.