I'm trying to get RabbitMQ 3.7.3 working with Docker Swarm's service discovery. I raised a
GitHub issue where I showed that My RabbitMQ instances start but are unable to discover each other. Here is what I've tried:
rabbitmq.conf
cluster_formation.peer_discovery_backend = rabbit_peer_discovery_dns
cluster_formation.dns.hostname = rabbitmq
docker-stack.yml
version: '3.3'
services:
rabbitmq:
image: rabbitmq:3.7.0
deploy:
endpoint_mode: dnsrr
replicas: 3
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=password
- RABBITMQ_ERLANG_COOKIE=foobar
- RABBITMQ_USE_LONGNAME=true
#healthcheck:
# test: ["rabbitmqctl", "node_health_check"]
# interval: 60s
# timeout: 5s
# retries: 3
networks:
- myoverlay
ports:
- mode: host
target: 25672
published: 25672
- mode: host
target: 15672
published: 15672
- mode: host
target: 5672
published: 5672
- mode: host
target: 4369
published: 4369
networks:
myoverlay:
I can't seem to get my cluster to form. Has anyone managed to getRabbitMQ working on a Docker Swarm. Is Docker Swarm being considered for being one of the built in methods of auto-scaling?