I’m trying to set up a 3 node Consul cluster running it in Docker on separate VMs in Openstack using docker-compose. This is my first attempt at this so I don’t know what I’m doing wrong. I’m getting the following errors in the logs among others:
2025-06-27T21:17:05.314Z [ERROR] agent.anti_entropy: failed to sync remote state: error=“No cluster leader”
2025-06-27T21:17:05.329Z [WARN] agent.leaf-certs: handling error in Manager.Notify: error=“No cluster leader” index=1
2025-06-27T21:17:05.329Z [ERROR] agent.server.cert-manager: failed to handle cache update event: error=“leaf cert watch returned an error: No cluster leader”
2025-06-27T21:17:05.453Z [WARN] agent.server.memberlist.lan: memberlist: Got ping for unexpected node 16e3f3e143da from=172.20.0.2:57536
2025-06-27T21:17:05.453Z [ERROR] agent.server.memberlist.lan: memberlist: Failed fallback TCP ping: EOF
2025-06-27T21:17:08.952Z [INFO] agent.server.memberlist.lan: memberlist: Suspect 16e3f3e143da has failed, no acks received
2025-06-27T21:17:16.457Z [WARN] agent.leaf-certs: handling error in Manager.Notify: error=“No cluster leader” index=1
2025-06-27T21:17:23.170Z [ERROR] agent: Coordinate update error: error=“No cluster leader”
2025-06-27T21:17:26.958Z [INFO] agent.server.serf.lan: serf: attempting reconnect to 16e3f3e143da 172.20.0.2:8301
2025-06-27T21:17:34.707Z [ERROR] agent.anti_entropy: failed to sync remote state: error=“No cluster leader”
2025-06-27T21:17:35.909Z [WARN] agent.leaf-certs: handling error in Manager.Notify: error=“No cluster leader” index=1
2025-06-27T21:17:44.396Z [WARN] agent.leaf-certs: handling error in Manager.Notify: error=“No cluster leader” index=1
My docker-compose.yml is the same on all 3 servers:
version: ‘3.8’
networks:
consul-network:
services:
server:
image: hashicorp/consul:1.21.2
command: agent -server -bootstrap-expect=3 -client=0.0.0.0 -ui -data-dir=/consul/data -retry-join 172.17.1.246 -retry-join 172.17.0.83 -retry-join 172.17.2.240
environment:
- CONSUL_BIND_INTERFACE=eth0
volumes:
- consul_data:/consul/data
ports:
- “8500:8500”
- “8301:8301”
- “8301:8301/udp”
- “8600:8600”
- “8600:8600/udp”
networks:
- consul-network
restart: always
volumes:
consul_data: