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

can't set consul.serf_lan.memberlist in config file #4058

Closed
weiwei04 opened this issue Apr 25, 2018 · 2 comments
Closed

can't set consul.serf_lan.memberlist in config file #4058

weiwei04 opened this issue Apr 25, 2018 · 2 comments
Labels
type/enhancement Proposed improvement or new feature
Milestone

Comments

@weiwei04
Copy link
Contributor

weiwei04 commented Apr 25, 2018

Description of the Issue (and unexpected/desired result)

below is my consul client config.json

{
  "bootstrap": false,
  "datacenter": "dc1",
  "data_dir": "/data0/consul",
  "log_level": "INFO",
  "enable_syslog": true,
  "retry_join": [
"consul0", "consul1", "consul2"
  ],
  "consul": {
    "serf_lan": {
      "memberlist": {
        "probe_timeout": "600ms",
        "probe_interval": "2s"
      }
    }
  }
}

curl -v "http://127.0.0.1:8500/v1/agent/self" got

...
    "ConsulSerfLANProbeInterval": "1s",
    "ConsulSerfLANProbeTimeout": "500ms",
...

seems the default config defined in

https://github.com/hashicorp/consul/blob/master/agent/config/default.go#L183

override the config.json

According to the comments in https://github.com/hashicorp/consul/blob/master/agent/config/builder.go#L35

// The sources are merged in the following order:
//
//  * default configuration
//  * config files in alphabetical order
//  * command line arguments```

seems the current NewBuilder impl was not correct,
https://github.com/hashicorp/consul/blob/master/agent/config/builder.go#L112

	b.Head = append(b.Head, newSource("flags.slices", slices))

https://github.com/hashicorp/consul/blob/master/agent/config/builder.go#L128

       b.Tail = append(b.Tail, NonUserSource(), DefaultConsulSource(), DefaultEnterpriseSource(), DefaultVersionSource())

the b.Tail(DefaultConsulSource()) overrides the b.Sources(which was parsed from config file)

@pearkes pearkes added the type/enhancement Proposed improvement or new feature label Jul 24, 2018
@pearkes pearkes added this to the 1.2.2 milestone Jul 24, 2018
@pearkes
Copy link
Contributor

pearkes commented Jul 24, 2018

This currently isn't possible at the user configuration layer. We are adding similar configuration values in an upcoming release, so it is possible these could be as well. I'm going to tag that here so we see it. However, if it isn't possible to simply plumb these through we'll likely close this as we don't believe this low-level configuration should be necessary in most networks.

cc/ @mkeeler

@mkeeler
Copy link
Member

mkeeler commented Jul 26, 2018

@weiwei04 The new configuration exists at the top level now like: (hcl syntax)

gossip_lan {
   probe_timeout = ...
   probe_interval = ...
}
gossip_wan {
   probe_timeout = ...
   probe_interval = ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Proposed improvement or new feature
Projects
None yet
Development

No branches or pull requests

3 participants