Browse Source

Warn when attempting to bootstrap an even number of nodes (#3158)

* Warn when attempting to bootstrap an even number of nodes.  Addresses #1282
* add more detailed warning for two server case
pull/3142/merge
Jared Wasinger 8 years ago committed by James Phillips
parent
commit
3cdde3c7ca
  1. 9
      command/agent.go

9
command/agent.go

@ -411,6 +411,15 @@ func (cmd *AgentCommand) readConfig() *agent.Config {
cmd.UI.Error(fmt.Sprintf("WARNING: Expect Mode enabled, expecting %d servers", cfg.BootstrapExpect))
}
// Warn if we are expecting an even number of servers
if cfg.BootstrapExpect != 0 && cfg.BootstrapExpect%2 == 0 {
if cfg.BootstrapExpect == 2 {
cmd.UI.Error("WARNING: A cluster with 2 servers will provide no failure tolerance. See https://www.consul.io/docs/internals/consensus.html#deployment-table")
} else {
cmd.UI.Error("WARNING: A cluster with an even number of servers does not achieve optimum fault tolerance. See https://www.consul.io/docs/internals/consensus.html#deployment-table")
}
}
// Warn if we are in bootstrap mode
if cfg.Bootstrap {
cmd.UI.Error("WARNING: Bootstrap mode enabled! Do not enable unless necessary")

Loading…
Cancel
Save