I have a docker compose yaml file that runs a consul container. The file has following lines.
version: ‘2’
services:
consul:
command: -server -bootstrap -ui-dir /ui
image: progrium/consul:latest
ports:
- “8300:8300”
- “8400:8400”
- “8500:8500”
- “8600:55/udp”
When I start the container with docker-compose up, I get following output.
e[36mconsul_1 |e[0m ==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
e[36mconsul_1 |e[0m ==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
e[36mconsul_1 |e[0m ==> Starting raft data migration…
e[36mconsul_1 |e[0m ==> Starting Consul agent…
e[36mconsul_1 |e[0m ==> Starting Consul agent RPC…
e[36mconsul_1 |e[0m ==> Consul agent running!
e[36mconsul_1 |e[0m Node name: ‘1c8b3517a08b’
e[36mconsul_1 |e[0m Datacenter: ‘dc1’
e[36mconsul_1 |e[0m Server: true (bootstrap: true)
e[36mconsul_1 |e[0m Client Addr: 0.0.0.0 (HTTP: 8500, HTTPS: -1, DNS: 53, RPC: 8400)
e[36mconsul_1 |e[0m Cluster Addr: 172.20.0.2 (LAN: 8301, WAN: 8302)
e[36mconsul_1 |e[0m Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false
e[36mconsul_1 |e[0m Atlas:
e[36mconsul_1 |e[0m
e[36mconsul_1 |e[0m ==> Log data will now stream in as it occurs:
e…
[36mconsul_1 |e[0m 2016/07/05 09:15:26 [INFO] raft: Node at 172.20.0.2:8300 [Candidate] entering Candidate state
e[36mconsul_1 |e[0m 2016/07/05 09:15:26 [ERR] raft: Failed to make RequestVote RPC to 10.0.75.10:8300: dial tcp 10.0.75.10:8300: no route to host
e[36mconsul_1 |e[0m 2016/07/05 09:15:26 [ERR] raft: Failed to make RequestVote RPC to 10.0.75.10:8300: dial tcp 10.0.75.10:8300: no route to host
e[36mconsul_1 |e[0m 2016/07/05 09:15:26 [ERR] raft: Failed to make RequestVote RPC to 10.0.75.10:8300: dial tcp 10.0.75.10:8300: no route to host
e[36mconsul_1 |e[0m 2016/07/05 09:15:26 [ERR] raft: Failed to make RequestVote RPC to 172.20.0.5:8300: dial tcp 172.20.0.5:8300: no route to host
e[36mconsul_1 |e[0m 2016/07/05 09:15:26 [ERR] raft: Failed to make RequestVote RPC to 172.20.0.5:8300: dial tcp 172.20.0.5:8300: no route to host
e[36mconsul_1 |e[0m 2016/07/05 09:15:26 [ERR] raft: Failed to make RequestVote RPC to 172.20.0.5:8300: dial tcp 172.20.0.5:8300: no route to host
e[36mconsul_1 |e[0m 2016/07/05 09:15:27 [WARN] raft: Election timeout reached, restarting election
e
When the container is started on a Docker linux environment there is no problem with Consul and a leader is elected.
I have uploaded diagnostics with id 9E54D51C-0F00-4C64-B7B4-D56522D9D2D2/2016-07-05_11-22-24