Windows and Linux agents handle default bind 0.0.0.0 differently

26 views
Skip to first unread message

Brian McGee

unread,
May 11, 2017, 1:03:45 PM5/11/17
to Serf

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
    .....

James Phillips

unread,
Jun 1, 2017, 12:38:08 AM6/1/17
to ser...@googlegroups.com
Hi Brian, sorry for the late reply on this one. You can use
https://www.serf.io/docs/agent/options.html#advertise to control the
address that's given to the rest of the cluster (or bind to the
external interface IP).

There is a difference in the code path for Windows and Linux -
https://github.com/hashicorp/serf/blob/master/cmd/serf/command/agent/command.go#L209-L272.
This logic is a bit out of date, and we've done some work in Consul to
select a better address automatically. If you'd like to open a Github
issue we can see about improving this by porting that back to Serf.

Thanks!

-- James
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/hashicorp/serf/issues
> IRC: #serfdom on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Serf" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to serfdom+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/serfdom/4a0bc288-8ce3-4ee9-bb4c-dce65e123e8d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages