hashicorp/consul

Automatically skip self-join

Open

#2.868 aberto em 4 de abr. de 2017

Ver no GitHub
 (22 comments) (4 reactions) (1 assignee)Go (4.588 forks)batch import
Hacktoberfesthelp-wantedtheme/operator-usabilitytype/docstype/enhancement

Métricas do repositório

Stars
 (29.891 stars)
Métricas de merge de PR
 (Mesclagem média 8d 12h) (41 fundiu PRs em 30d)

Description

It is unclear to me from the docs of start_join/retry_join whether this value should contain all consul servers that I want in the cluster, or only the other ones (not the current machine).

Looking at a 3-node cluster boostrapping from a automatic deployment, it seems to me that it has to be the latter, because otherwise if retry_join = [machine1, machine2, machine3]:

  • machine1 boots up first, sees only itself, joins itself
  • machine2 and 3 boot at the same time a bit later, try to join each other first, which succeeds

Because the behaviour of retry_join is "Takes a list of addresses to attempt joining every retry_interval until at least one join works" instead of "until all joins work", each none of the machines try to join any other machines.

So due to this race we end up in a situation where we have 2 split clusters {machine1} and {machine2,machine3}, as opposed to the desired {machine1,machine2,machine3}. And it stays that way.

And then we get lots of agent: failed to sync remote state: No cluster leader.

Is this analysis correct?

Guia do colaborador