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

Serf uses loopback address on public IP address nodes by default #62

Closed
sigmonsays opened this issue Nov 10, 2013 · 8 comments
Closed
Labels
Milestone

Comments

@sigmonsays
Copy link

If you fail to pass the appropriate bind network address via -bind, serf will use 127.0.0.1 as the nodes address. This causes members in the cluster to see the node as 127.0.0.1.

A fix is to pass the public IP to serf agent via the -bind argument, however it should not use the loopback address by default.

Serf currently uses the first private IP address it can find... which happens to be 127.0.0.1.

@mitchellh
Copy link
Contributor

Yes, I don't think this is ever the correct behavior. I think the correct behavior would be to error in this case, because you also probably don't want Serf to just bind to a public network. I think Serf should error if no explicit bind address is set and the only one it can detect is a public one.

If you explicitly set a bind address to the public IP, then it is fine.

Thoughts?

@sigmonsays
Copy link
Author

I dont fully understand the implications of serf running on a public network. The encryption key protects other members from joining the cluster, so it seems like it would be up to the administrator to responsibly setup the cluster. regardless of the node being in a private or public network, it seems like using dns to lookup the hostname to an IP address would be the correct behavior.

@armon
Copy link
Member

armon commented Nov 10, 2013

We also have to consider the case of not using encryption. Basically, if you want serf to run on a public network I prefer it is explicit so we don't have to deal with people accidentally running over a public network without encryption and then being surprised when there is an incident. I think @mitchellh has a good point that if we cannot find a suitable private address, we should error instead of using loopback.

@thedrow
Copy link
Contributor

thedrow commented Nov 11, 2013

You should probably warn when binding to a public network without encryption explicitly.

@mitchellh
Copy link
Contributor

@thedrow That is a great idea.

@sigmonsays
Copy link
Author

I second @thedrow

@armon
Copy link
Member

armon commented Nov 22, 2013

In hashicorp/memberlist@e15d81a we now warn if binding to a public address without encryption

@armon
Copy link
Member

armon commented Nov 22, 2013

And in hashicorp/memberlist@54a7ab8 we now error if bind address is "0.0.0.0" and no private IP can be found. Default behavior before was to use loopback.

@armon armon closed this as completed Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants