hashicorp / hashicorp/serf

Configurable profiles

Open
#252 1 comment 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.