Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing bootstrap-expect #31

Closed
kshep opened this issue Aug 4, 2014 · 5 comments
Closed

Implementing bootstrap-expect #31

kshep opened this issue Aug 4, 2014 · 5 comments

Comments

@kshep
Copy link

kshep commented Aug 4, 2014

Per the current Consul docs:

The recommended way to bootstrap is to use the -bootstrap-expect configuration option. This options informs Consul of the expected number of server nodes, and automatically bootstraps when that many servers are available. To prevent inconsistencies and split-brain situations, all servers should specify the same value for -bootstrap-expect or specify no value at all. Any server that does not specify a value will not attempt to bootstrap the cluster.

-- http://www.consul.io/docs/guides/bootstrapping.html

Should there be a new ['consul']['service_mode'] setting for bootstrap-expect?

I'd be happy to tackle this and submit a PR if it's not a high priority for anybody else.

@johnbellone
Copy link
Contributor

@pyanni and I were talking about this yesterday. I am going to defer to him for some insight. But if you have a few free cycles and want to jam out a PR we'd definitely accept it.

johnbellone pushed a commit that referenced this issue Sep 7, 2014
fix for #31 , implements support for bootstrap-expect and now creates the data_dir
@lawsonj2019
Copy link
Contributor

Is this not as simple as modifying the _service.rb recipe in the case statement so that clusters can also have a start_join list? All the hard work has already been done, it's just a case of adding service_config['start_join'] = node['consul']['servers'] when you have a cluster with a known bootstrap_expect value.

when 'cluster'
  service_config['server'] = true
  if num_cluster > 1
    service_config['bootstrap_expect'] = num_cluster
    service_config['start_join'] = node['consul']['servers']
  else
    service_config['bootstrap'] = true
  end

Or does this have unintended side effects I'm not aware of?

I've tested this with a three-node vagrant cluster and it auto bootstraps the cluster and elects a leader.

@johnbellone
Copy link
Contributor

I am going to have to test that a bit. Would you mind submitting a PR and referencing this issue?

@kainosnoema
Copy link

This looks resolved to me. Thanks!

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants