Mgccon
Mgccon

Reputation: 425

Swarm Cluster Consul setup

I am currently trying to setup a Docker cluster in the following way:

I made some HA testing and found the follwing behavior:

I have restarted NodeB while monitoring the docker cluster info and I noticed that SwarmNode2 was disconnected from the cluster during the reboot time. The explanation I have is that because Consul2 goes down and Node2 is configured to connect to that same Consul it becomes unavailable on the cluster perspective.

What is the correct way to setup the discovery service for the Swarm containers in order to avoid this problem?

Upvotes: 0

Views: 179

Answers (1)

Alon Torres
Alon Torres

Reputation: 131

I suggest creating a consul cluster, preferably stand-alone on different nodes. Once the cluster is created, all consul clients should continue functioning properly as long as quorum is maintained.

I also suggest giving multiple consul server addresses with the -join flag, to ensure the agent will be able to rejoin in case it restarts while some of the consul servers are down.

Upvotes: 3

Related Questions