-
Notifications
You must be signed in to change notification settings - Fork 596
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
Comments
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? |
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. |
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. |
You should probably warn when binding to a public network without encryption explicitly. |
@thedrow That is a great idea. |
I second @thedrow |
In hashicorp/memberlist@e15d81a we now warn if binding to a public address without encryption |
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. |
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.
The text was updated successfully, but these errors were encountered: