From 23c492a74e19c602752d3f3924055f1dadd55b98 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Tue, 28 Feb 2017 14:23:14 -0800 Subject: [PATCH] Rename DeadServerCleanup and make wording adjustments --- api/operator.go | 13 ++++++++---- api/operator_test.go | 16 +++++++-------- command/agent/agent.go | 4 ++-- command/agent/config.go | 8 ++++---- command/agent/config_test.go | 8 ++++---- command/agent/operator_endpoint_test.go | 16 +++++++-------- command/operator_autopilot_get.go | 2 +- command/operator_autopilot_get_test.go | 2 +- command/operator_autopilot_set.go | 8 ++++---- command/operator_autopilot_set_test.go | 4 ++-- consul/config.go | 2 +- consul/leader.go | 2 +- consul/leader_test.go | 2 +- consul/operator_endpoint.go | 4 +--- consul/operator_endpoint_test.go | 20 +++++++++---------- consul/state/autopilot_test.go | 17 ++++++++-------- consul/structs/operator.go | 4 ++-- .../docs/agent/http/operator.html.markdown | 8 ++++---- .../source/docs/agent/options.html.markdown | 4 ++-- .../operator/autopilot.html.markdown.erb | 4 ++-- 20 files changed, 75 insertions(+), 73 deletions(-) diff --git a/api/operator.go b/api/operator.go index 9d977b318..b7129cdde 100644 --- a/api/operator.go +++ b/api/operator.go @@ -71,17 +71,22 @@ type KeyringResponse struct { NumNodes int } -// AutopilotConfiguration is used for querying/setting the Autopilot configuration +// AutopilotConfiguration is used for querying/setting the Autopilot configuration. +// Autopilot helps manage operator tasks related to Consul servers like removing +// failed servers from the Raft quorum. type AutopilotConfiguration struct { - // DeadServerCleanup controls whether to remove dead servers from the Raft + // CleanupDeadServers controls whether to remove dead servers from the Raft // peer list when a new server joins - DeadServerCleanup bool + CleanupDeadServers bool // CreateIndex holds the index corresponding the creation of this configuration. // This is a read-only field. CreateIndex uint64 - // ModifyIndex is used for doing a Check-And-Set update operation. + // ModifyIndex will be set to the index of the last update when retrieving the + // Autopilot configuration. Resubmitting a configuration with + // AutopilotCASConfiguration will perform a check-and-set operation which ensures + // there hasn't been a subsequent update since the configuration was retrieved. ModifyIndex uint64 } diff --git a/api/operator_test.go b/api/operator_test.go index e5e1e122b..13ce53e61 100644 --- a/api/operator_test.go +++ b/api/operator_test.go @@ -115,12 +115,12 @@ func TestOperator_AutopilotGetSetConfiguration(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } - if !config.DeadServerCleanup { + if !config.CleanupDeadServers { t.Fatalf("bad: %v", config) } // Change a config setting - newConf := &AutopilotConfiguration{DeadServerCleanup: false} + newConf := &AutopilotConfiguration{CleanupDeadServers: false} if err := operator.AutopilotSetConfiguration(newConf, nil); err != nil { t.Fatalf("err: %v", err) } @@ -129,7 +129,7 @@ func TestOperator_AutopilotGetSetConfiguration(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } - if config.DeadServerCleanup { + if config.CleanupDeadServers { t.Fatalf("bad: %v", config) } } @@ -144,15 +144,15 @@ func TestOperator_AutopilotCASConfiguration(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } - if !config.DeadServerCleanup { + if !config.CleanupDeadServers { t.Fatalf("bad: %v", config) } // Pass an invalid ModifyIndex { newConf := &AutopilotConfiguration{ - DeadServerCleanup: false, - ModifyIndex: config.ModifyIndex - 1, + CleanupDeadServers: false, + ModifyIndex: config.ModifyIndex - 1, } resp, err := operator.AutopilotCASConfiguration(newConf, nil) if err != nil { @@ -166,8 +166,8 @@ func TestOperator_AutopilotCASConfiguration(t *testing.T) { // Pass a valid ModifyIndex { newConf := &AutopilotConfiguration{ - DeadServerCleanup: false, - ModifyIndex: config.ModifyIndex, + CleanupDeadServers: false, + ModifyIndex: config.ModifyIndex, } resp, err := operator.AutopilotCASConfiguration(newConf, nil) if err != nil { diff --git a/command/agent/agent.go b/command/agent/agent.go index 8e4d0b6c9..26d07fe63 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -416,8 +416,8 @@ func (a *Agent) consulConfig() *consul.Config { if a.config.SessionTTLMinRaw != "" { base.SessionTTLMin = a.config.SessionTTLMin } - if a.config.Autopilot.DeadServerCleanup != nil { - base.AutopilotConfig.DeadServerCleanup = *a.config.Autopilot.DeadServerCleanup + if a.config.Autopilot.CleanupDeadServers != nil { + base.AutopilotConfig.CleanupDeadServers = *a.config.Autopilot.CleanupDeadServers } // Format the build string diff --git a/command/agent/config.go b/command/agent/config.go index 6d5f5420d..768ca2864 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -264,9 +264,9 @@ type Telemetry struct { // Autopilot is used to configure helpful features for operating Consul servers. type Autopilot struct { - // DeadServerCleanup enables the automatic cleanup of dead servers when new ones + // CleanupDeadServers enables the automatic cleanup of dead servers when new ones // are added to the peer list. Defaults to true. - DeadServerCleanup *bool `mapstructure:"dead_server_cleanup"` + CleanupDeadServers *bool `mapstructure:"cleanup_dead_servers"` } // Config is the configuration that can be set for an Agent. @@ -1347,8 +1347,8 @@ func MergeConfig(a, b *Config) *Config { if b.SkipLeaveOnInt != nil { result.SkipLeaveOnInt = b.SkipLeaveOnInt } - if b.Autopilot.DeadServerCleanup != nil { - result.Autopilot.DeadServerCleanup = b.Autopilot.DeadServerCleanup + if b.Autopilot.CleanupDeadServers != nil { + result.Autopilot.CleanupDeadServers = b.Autopilot.CleanupDeadServers } if b.Telemetry.DisableHostname == true { result.Telemetry.DisableHostname = true diff --git a/command/agent/config_test.go b/command/agent/config_test.go index cad0a1898..a1d5c8073 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -1110,13 +1110,13 @@ func TestDecodeConfig_Performance(t *testing.T) { } func TestDecodeConfig_Autopilot(t *testing.T) { - input := `{"autopilot": { "dead_server_cleanup": true }}` + input := `{"autopilot": { "cleanup_dead_servers": true }}` config, err := DecodeConfig(bytes.NewReader([]byte(input))) if err != nil { t.Fatalf("err: %s", err) } - if config.Autopilot.DeadServerCleanup == nil || !*config.Autopilot.DeadServerCleanup { - t.Fatalf("bad: dead_server_cleanup isn't set: %#v", config) + if config.Autopilot.CleanupDeadServers == nil || !*config.Autopilot.CleanupDeadServers { + t.Fatalf("bad: cleanup_dead_servers isn't set: %#v", config) } } @@ -1643,7 +1643,7 @@ func TestMergeConfig(t *testing.T) { SkipLeaveOnInt: Bool(true), RaftProtocol: 3, Autopilot: Autopilot{ - DeadServerCleanup: Bool(true), + CleanupDeadServers: Bool(true), }, EnableDebug: true, VerifyIncoming: true, diff --git a/command/agent/operator_endpoint_test.go b/command/agent/operator_endpoint_test.go index 081eb6ab7..0915eba45 100644 --- a/command/agent/operator_endpoint_test.go +++ b/command/agent/operator_endpoint_test.go @@ -306,7 +306,7 @@ func TestOperator_AutopilotGetConfiguration(t *testing.T) { if !ok { t.Fatalf("unexpected: %T", obj) } - if !out.DeadServerCleanup { + if !out.CleanupDeadServers { t.Fatalf("bad: %#v", out) } }) @@ -314,7 +314,7 @@ func TestOperator_AutopilotGetConfiguration(t *testing.T) { func TestOperator_AutopilotSetConfiguration(t *testing.T) { httpTest(t, func(srv *HTTPServer) { - body := bytes.NewBuffer([]byte(`{"DeadServerCleanup": false}`)) + body := bytes.NewBuffer([]byte(`{"CleanupDeadServers": false}`)) req, err := http.NewRequest("PUT", "/v1/operator/autopilot/configuration", body) if err != nil { t.Fatalf("err: %v", err) @@ -336,7 +336,7 @@ func TestOperator_AutopilotSetConfiguration(t *testing.T) { if err := srv.agent.RPC("Operator.AutopilotGetConfiguration", &args, &reply); err != nil { t.Fatalf("err: %v", err) } - if reply.DeadServerCleanup { + if reply.CleanupDeadServers { t.Fatalf("bad: %#v", reply) } }) @@ -344,7 +344,7 @@ func TestOperator_AutopilotSetConfiguration(t *testing.T) { func TestOperator_AutopilotCASConfiguration(t *testing.T) { httpTest(t, func(srv *HTTPServer) { - body := bytes.NewBuffer([]byte(`{"DeadServerCleanup": false}`)) + body := bytes.NewBuffer([]byte(`{"CleanupDeadServers": false}`)) req, err := http.NewRequest("PUT", "/v1/operator/autopilot/configuration", body) if err != nil { t.Fatalf("err: %v", err) @@ -367,13 +367,13 @@ func TestOperator_AutopilotCASConfiguration(t *testing.T) { t.Fatalf("err: %v", err) } - if reply.DeadServerCleanup { + if reply.CleanupDeadServers { t.Fatalf("bad: %#v", reply) } // Create a CAS request, bad index { - buf := bytes.NewBuffer([]byte(`{"DeadServerCleanup": true}`)) + buf := bytes.NewBuffer([]byte(`{"CleanupDeadServers": true}`)) req, err := http.NewRequest("PUT", fmt.Sprintf("/v1/operator/autopilot/configuration?cas=%d", reply.ModifyIndex-1), buf) if err != nil { @@ -393,7 +393,7 @@ func TestOperator_AutopilotCASConfiguration(t *testing.T) { // Create a CAS request, good index { - buf := bytes.NewBuffer([]byte(`{"DeadServerCleanup": true}`)) + buf := bytes.NewBuffer([]byte(`{"CleanupDeadServers": true}`)) req, err := http.NewRequest("PUT", fmt.Sprintf("/v1/operator/autopilot/configuration?cas=%d", reply.ModifyIndex), buf) if err != nil { @@ -415,7 +415,7 @@ func TestOperator_AutopilotCASConfiguration(t *testing.T) { if err := srv.agent.RPC("Operator.AutopilotGetConfiguration", &args, &reply); err != nil { t.Fatalf("err: %v", err) } - if !reply.DeadServerCleanup { + if !reply.CleanupDeadServers { t.Fatalf("bad: %#v", reply) } }) diff --git a/command/operator_autopilot_get.go b/command/operator_autopilot_get.go index ed714f881..d5b195d9f 100644 --- a/command/operator_autopilot_get.go +++ b/command/operator_autopilot_get.go @@ -55,7 +55,7 @@ func (c *OperatorAutopilotGetCommand) Run(args []string) int { c.Ui.Error(fmt.Sprintf("Error querying Autopilot configuration: %s", err)) return 1 } - c.Ui.Output(fmt.Sprintf("DeadServerCleanup = %v", config.DeadServerCleanup)) + c.Ui.Output(fmt.Sprintf("CleanupDeadServers = %v", config.CleanupDeadServers)) return 0 } diff --git a/command/operator_autopilot_get_test.go b/command/operator_autopilot_get_test.go index 74496d0f1..d8d7241dc 100644 --- a/command/operator_autopilot_get_test.go +++ b/command/operator_autopilot_get_test.go @@ -31,7 +31,7 @@ func TestOperator_Autopilot_Get(t *testing.T) { t.Fatalf("bad: %d. %#v", code, ui.ErrorWriter.String()) } output := strings.TrimSpace(ui.OutputWriter.String()) - if !strings.Contains(output, "DeadServerCleanup = true") { + if !strings.Contains(output, "CleanupDeadServers = true") { t.Fatalf("bad: %s", output) } } diff --git a/command/operator_autopilot_set.go b/command/operator_autopilot_set.go index a0a47c2d3..d87687e03 100644 --- a/command/operator_autopilot_set.go +++ b/command/operator_autopilot_set.go @@ -28,11 +28,11 @@ func (c *OperatorAutopilotSetCommand) Synopsis() string { } func (c *OperatorAutopilotSetCommand) Run(args []string) int { - var deadServerCleanup base.BoolValue + var cleanupDeadServers base.BoolValue f := c.Command.NewFlagSet(c) - f.Var(&deadServerCleanup, "dead-server-cleanup", + f.Var(&cleanupDeadServers, "cleanup-dead-servers", "Controls whether Consul will automatically remove dead servers "+ "when new ones are successfully added. Must be one of `true|false`.") @@ -60,7 +60,7 @@ func (c *OperatorAutopilotSetCommand) Run(args []string) int { } // Update the config values. - deadServerCleanup.Merge(&conf.DeadServerCleanup) + cleanupDeadServers.Merge(&conf.CleanupDeadServers) // Check-and-set the new configuration. result, err := operator.AutopilotCASConfiguration(conf, nil) @@ -72,7 +72,7 @@ func (c *OperatorAutopilotSetCommand) Run(args []string) int { c.Ui.Output("Configuration updated!") return 0 } else { - c.Ui.Output("Configuration could not be atomically updated") + c.Ui.Output("Configuration could not be atomically updated, please try again") return 1 } } diff --git a/command/operator_autopilot_set_test.go b/command/operator_autopilot_set_test.go index e9da49e41..f4cab0b58 100644 --- a/command/operator_autopilot_set_test.go +++ b/command/operator_autopilot_set_test.go @@ -25,7 +25,7 @@ func TestOperator_Autopilot_Set(t *testing.T) { Flags: base.FlagSetHTTP, }, } - args := []string{"-http-addr=" + a1.httpAddr, "-dead-server-cleanup=false"} + args := []string{"-http-addr=" + a1.httpAddr, "-cleanup-dead-servers=false"} code := c.Run(args) if code != 0 { @@ -44,7 +44,7 @@ func TestOperator_Autopilot_Set(t *testing.T) { t.Fatalf("err: %v", err) } - if reply.DeadServerCleanup { + if reply.CleanupDeadServers { t.Fatalf("bad: %#v", reply) } } diff --git a/consul/config.go b/consul/config.go index b2b09dbb9..7502cbdb8 100644 --- a/consul/config.go +++ b/consul/config.go @@ -353,7 +353,7 @@ func DefaultConfig() *Config { TLSMinVersion: "tls10", AutopilotConfig: &structs.AutopilotConfig{ - DeadServerCleanup: true, + CleanupDeadServers: true, }, } diff --git a/consul/leader.go b/consul/leader.go index 9482f774d..64e1671aa 100644 --- a/consul/leader.go +++ b/consul/leader.go @@ -618,7 +618,7 @@ func (s *Server) joinConsulServer(m serf.Member, parts *agent.Server) error { } // Look for dead servers to clean up - if autopilotConf.DeadServerCleanup { + if autopilotConf.CleanupDeadServers { for _, member := range s.serfLAN.Members() { valid, _ := agent.IsConsulServer(member) if valid && member.Name != m.Name && member.Status == serf.StatusFailed { diff --git a/consul/leader_test.go b/consul/leader_test.go index cd9f1663f..7549e19ad 100644 --- a/consul/leader_test.go +++ b/consul/leader_test.go @@ -623,7 +623,7 @@ func TestLeader_ReapTombstones(t *testing.T) { }) } -func TestLeader_DeadServerCleanup(t *testing.T) { +func TestLeader_CleanupDeadServers(t *testing.T) { dir1, s1 := testServerDCBootstrap(t, "dc1", true) defer os.RemoveAll(dir1) defer s1.Shutdown() diff --git a/consul/operator_endpoint.go b/consul/operator_endpoint.go index a130e6b2b..61d6d25f3 100644 --- a/consul/operator_endpoint.go +++ b/consul/operator_endpoint.go @@ -141,8 +141,6 @@ func (op *Operator) AutopilotGetConfiguration(args *structs.DCSpecificRequest, r return permissionDeniedErr } - // We can't fetch the leader and the configuration atomically with - // the current Raft API. state := op.srv.fsm.State() _, config, err := state.AutopilotConfig() if err != nil { @@ -160,7 +158,7 @@ func (op *Operator) AutopilotSetConfiguration(args *structs.AutopilotSetConfigRe return err } - // This action requires operator read access. + // This action requires operator write access. acl, err := op.srv.resolveToken(args.Token) if err != nil { return err diff --git a/consul/operator_endpoint_test.go b/consul/operator_endpoint_test.go index e7cfdb772..173bd9299 100644 --- a/consul/operator_endpoint_test.go +++ b/consul/operator_endpoint_test.go @@ -246,7 +246,7 @@ func TestOperator_RaftRemovePeerByAddress_ACLDeny(t *testing.T) { func TestOperator_Autopilot_GetConfiguration(t *testing.T) { dir1, s1 := testServerWithConfig(t, func(c *Config) { - c.AutopilotConfig.DeadServerCleanup = false + c.AutopilotConfig.CleanupDeadServers = false }) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -263,7 +263,7 @@ func TestOperator_Autopilot_GetConfiguration(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } - if reply.DeadServerCleanup { + if reply.CleanupDeadServers { t.Fatalf("bad: %#v", reply) } } @@ -273,7 +273,7 @@ func TestOperator_Autopilot_GetConfiguration_ACLDeny(t *testing.T) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" c.ACLDefaultPolicy = "deny" - c.AutopilotConfig.DeadServerCleanup = false + c.AutopilotConfig.CleanupDeadServers = false }) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -320,14 +320,14 @@ func TestOperator_Autopilot_GetConfiguration_ACLDeny(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } - if reply.DeadServerCleanup { + if reply.CleanupDeadServers { t.Fatalf("bad: %#v", reply) } } func TestOperator_Autopilot_SetConfiguration(t *testing.T) { dir1, s1 := testServerWithConfig(t, func(c *Config) { - c.AutopilotConfig.DeadServerCleanup = false + c.AutopilotConfig.CleanupDeadServers = false }) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -340,7 +340,7 @@ func TestOperator_Autopilot_SetConfiguration(t *testing.T) { arg := structs.AutopilotSetConfigRequest{ Datacenter: "dc1", Config: structs.AutopilotConfig{ - DeadServerCleanup: true, + CleanupDeadServers: true, }, } var reply *bool @@ -355,7 +355,7 @@ func TestOperator_Autopilot_SetConfiguration(t *testing.T) { if err != nil { t.Fatal(err) } - if !config.DeadServerCleanup { + if !config.CleanupDeadServers { t.Fatalf("bad: %#v", config) } } @@ -365,7 +365,7 @@ func TestOperator_Autopilot_SetConfiguration_ACLDeny(t *testing.T) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" c.ACLDefaultPolicy = "deny" - c.AutopilotConfig.DeadServerCleanup = false + c.AutopilotConfig.CleanupDeadServers = false }) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -378,7 +378,7 @@ func TestOperator_Autopilot_SetConfiguration_ACLDeny(t *testing.T) { arg := structs.AutopilotSetConfigRequest{ Datacenter: "dc1", Config: structs.AutopilotConfig{ - DeadServerCleanup: true, + CleanupDeadServers: true, }, } var reply *bool @@ -422,7 +422,7 @@ func TestOperator_Autopilot_SetConfiguration_ACLDeny(t *testing.T) { if err != nil { t.Fatal(err) } - if !config.DeadServerCleanup { + if !config.CleanupDeadServers { t.Fatalf("bad: %#v", config) } } diff --git a/consul/state/autopilot_test.go b/consul/state/autopilot_test.go index 64b2895d0..4e1e1c5b7 100644 --- a/consul/state/autopilot_test.go +++ b/consul/state/autopilot_test.go @@ -11,7 +11,7 @@ func TestStateStore_Autopilot(t *testing.T) { s := testStateStore(t) expected := &structs.AutopilotConfig{ - DeadServerCleanup: true, + CleanupDeadServers: true, } if err := s.AutopilotSetConfig(0, expected); err != nil { @@ -34,7 +34,7 @@ func TestStateStore_AutopilotCAS(t *testing.T) { s := testStateStore(t) expected := &structs.AutopilotConfig{ - DeadServerCleanup: true, + CleanupDeadServers: true, } if err := s.AutopilotSetConfig(0, expected); err != nil { @@ -46,14 +46,14 @@ func TestStateStore_AutopilotCAS(t *testing.T) { // Do a CAS with an index lower than the entry ok, err := s.AutopilotCASConfig(2, 0, &structs.AutopilotConfig{ - DeadServerCleanup: false, + CleanupDeadServers: false, }) if ok || err != nil { t.Fatalf("expected (false, nil), got: (%v, %#v)", ok, err) } // Check that the index is untouched and the entry - // has not been deleted. + // has not been updated. idx, config, err := s.AutopilotConfig() if err != nil { t.Fatal(err) @@ -61,20 +61,19 @@ func TestStateStore_AutopilotCAS(t *testing.T) { if idx != 1 { t.Fatalf("bad: %d", idx) } - if !config.DeadServerCleanup { + if !config.CleanupDeadServers { t.Fatalf("bad: %#v", config) } // Do another CAS, this time with the correct index ok, err = s.AutopilotCASConfig(2, 1, &structs.AutopilotConfig{ - DeadServerCleanup: false, + CleanupDeadServers: false, }) if !ok || err != nil { t.Fatalf("expected (true, nil), got: (%v, %#v)", ok, err) } - // Check that the index is untouched and the entry - // has not been deleted. + // Make sure the config was updated idx, config, err = s.AutopilotConfig() if err != nil { t.Fatal(err) @@ -82,7 +81,7 @@ func TestStateStore_AutopilotCAS(t *testing.T) { if idx != 2 { t.Fatalf("bad: %d", idx) } - if config.DeadServerCleanup { + if config.CleanupDeadServers { t.Fatalf("bad: %#v", config) } } diff --git a/consul/structs/operator.go b/consul/structs/operator.go index bb42ba7a9..b6a961bb3 100644 --- a/consul/structs/operator.go +++ b/consul/structs/operator.go @@ -5,9 +5,9 @@ import ( ) type AutopilotConfig struct { - // DeadServerCleanup controls whether to remove dead servers when a new + // CleanupDeadServers controls whether to remove dead servers when a new // server is added to the Raft peers - DeadServerCleanup bool + CleanupDeadServers bool // RaftIndex stores the create/modify indexes of this configuration RaftIndex diff --git a/website/source/docs/agent/http/operator.html.markdown b/website/source/docs/agent/http/operator.html.markdown index 12323971b..3d28aa3ee 100644 --- a/website/source/docs/agent/http/operator.html.markdown +++ b/website/source/docs/agent/http/operator.html.markdown @@ -287,13 +287,13 @@ A JSON body is returned that looks like this: ```javascript { - "DeadServerCleanup": true, + "CleanupDeadServers": true, "CreateIndex": 4, "ModifyIndex": 4 } ``` -`DeadServerCleanup` is whether dead servers should be removed automatically when +`CleanupDeadServers` is whether dead servers should be removed automatically when a new server is added to the cluster. #### PUT Method @@ -313,11 +313,11 @@ body must look like: ```javascript { - "DeadServerCleanup": true + "CleanupDeadServers": true } ``` -`DeadServerCleanup` is whether dead servers should be removed automatically when +`CleanupDeadServers` is whether dead servers should be removed automatically when a new server is added to the cluster. The return code will indicate success or failure. diff --git a/website/source/docs/agent/options.html.markdown b/website/source/docs/agent/options.html.markdown index 325fdcbdf..280b751d9 100644 --- a/website/source/docs/agent/options.html.markdown +++ b/website/source/docs/agent/options.html.markdown @@ -563,9 +563,9 @@ Consul will not enable TLS for the HTTP API unless the `https` port has been ass * `raft_protocol` - This controls the internal version of the Raft consensus protocol used for server communications. This defaults to 2 but must be set to 3 in order to gain access to other Autopilot features, with the exception of - [`dead_server_cleanup`](#dead_server_cleanup). + [`cleanup_dead_servers`](#cleanup_dead_servers). - * `dead_server_cleanup` - This controls + * `cleanup_dead_servers` - This controls the automatic removal of dead server nodes whenever a new server is added to the cluster. Defaults to `true`. * `bootstrap` Equivalent to the diff --git a/website/source/docs/commands/operator/autopilot.html.markdown.erb b/website/source/docs/commands/operator/autopilot.html.markdown.erb index a028914ad..5968a84b6 100644 --- a/website/source/docs/commands/operator/autopilot.html.markdown.erb +++ b/website/source/docs/commands/operator/autopilot.html.markdown.erb @@ -39,7 +39,7 @@ Usage: `consul operator autopilot get-config [options]` The output looks like this: ``` -DeadServerCleanup = true +CleanupDeadServers = true ``` ## set-config @@ -55,7 +55,7 @@ Usage: `consul operator autopilot set-config [options]` #### Command Options -* `-dead-server-cleanup` - Specifies whether to enable automatic removal of dead servers +* `-cleanup-dead-servers` - Specifies whether to enable automatic removal of dead servers upon the successful joining of new servers to the cluster. Must be one of `[true|false]`. The output looks like this: