hashicorp/consul

Automatically skip self-join

Open

#2,868 opened on 2017年4月4日

GitHub で見る
 (22 comments) (4 reactions) (1 assignee)Go (4,588 forks)batch import
Hacktoberfesthelp-wantedtheme/operator-usabilitytype/docstype/enhancement

Repository metrics

Stars
 (29,891 stars)
PR merge metrics
 (平均マージ 8d 12h) (30d で 41 merged PRs)

説明

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?

コントリビューターガイド