Configurable profiles
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 609
- Avg merge
- 15h 1m
- Merged PRs (30d)
- 3
Description
It would be nice to be able to adjust all the knobs associated with a memberlist.Config beyond the defaults (DefaultLANConfig() et al.).
For now I'm just patching in my own profile in:
https://github.com/hashicorp/serf/blob/master/command/agent/command.go.
``` go
serfConfig := serf.DefaultConfig()
switch config.Profile {
case "lan":
serfConfig.MemberlistConfig = memberlist.DefaultLANConfig()
case "wan":
serfConfig.MemberlistConfig = memberlist.DefaultWANConfig()
case "local":
serfConfig.MemberlistConfig = memberlist.DefaultLocalConfig()
case "custom":
customConf := memberlist.DefaultLANConfig()
customConf.ProbeInterval = time.Second * 10
customConf.ProbeTimeout = time.Second * 5
customConf.GossipInterval = time.Second * 20
customConf.GossipNodes = 2
customConf.TCPTimeout = time.Second * 5
serfConfig.MemberlistConfig = ultraConf
default:
c.Ui.Error(fmt.Sprintf("Unknown profile: %s", config.Profile))
return nil
}
```
It would be awesome if there was a way to load a custom profile from something like:
my_profile.json
``` javascript
{
"GossipInterval": 10,
"TCPTimeout": 5
}
```
Maybe build off DefaultLANConfig(), parse the file, and override any fields specified in it.
Contributor guide
Assessment
This issue has not been assessed yet.