Port improved logic to automatically select bind IP address from Consul to Serf
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 609
- Avg merge
- 15h 1m
- Merged PRs (30d)
- 3
Description
Per James Phillips from HashiCorp, the following logic to automatically select a bind IP address has been improved in Consul. I am requesting the Consul logic be ported back to Serf.
https://github.com/hashicorp/serf/blob/master/cmd/serf/command/agent/command.go#L209-L272
Background:
I start Windows and Linux agents both with the argument -bind=0.0.0.0:7946. The Windows and Linux machines each have a single physical interface. The Windows agent starts with the IP address of the physical interface, but the Linux agent starts with the IP address of the loopback interface. The behavior of the Windows agent is what I would expect. When the Linux agent starts with the IP of the loopback I get flooded with "refuting a suspect message" errors.
------------------------------------------------------------------------------------------------------
Windows binds to the IP of the physical interface on EventMemberJoin
------------------------------------------------------------------------------------------------------
C:\Serf\Serf.exe agent -bind=0.0.0.0:7946
==> Starting Serf agent...
==> Starting Serf agent RPC...
==> Serf agent running!
Node name: 'windows'
Bind addr: '0.0.0.0:7946'
RPC addr: '127.0.0.1:7373'
Encrypted: true
Snapshot: true
Profile: lan
==> Log data will now stream in as it occurs:
2017/05/11 11:32:32 [INFO] agent: Serf agent starting
2017/05/11 11:32:32 [INFO] serf: EventMemberJoin: windows 10.10.10.10
2017/05/11 11:32:33 [INFO] agent: Received event: member-join
2017/05/11 11:32:46 [INFO] agent.ipc: Accepted client: 127.0.0.1:50724
.....
-----------------------------------------------------------------------------------------------------
Linux binds to the IP of the loopback interface on EventMemberJoin
-----------------------------------------------------------------------------------------------------
/opt/Serf/serf agent -bind=0.0.0.0:7946
==> Starting Serf agent...
==> Starting Serf agent RPC...
==> Serf agent running!
Node name: 'linux'
Bind addr: '0.0.0.0:7946'
RPC addr: '127.0.0.1:7373'
Encrypted: true
Snapshot: true
Profile: lan
==> Log data will now stream in as it occurs:
2017/05/11 11:28:45 [INFO] agent: Serf agent starting
2017/05/11 11:28:45 [INFO] serf: EventMemberJoin: linux 127.0.0.1
2017/05/11 11:28:46 [INFO] agent: Received event: member-join
2017/05/11 11:29:58 [INFO] agent.ipc: Accepted client: 127.0.0.1:37575
.....
Contributor guide
Assessment
This issue has not been assessed yet.