-
Notifications
You must be signed in to change notification settings - Fork 21
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
TcpUtils.java only uses the first found non-local host address #89
Comments
Yes. This is definitely a problem in Docker. I've fixed this in other systems multiple ways (e.g. a standalone REST service with a well known location that tells the process that hits it it's external IP, using DC/OS VIPs, docker-compose overlay networks). This is compounded by the problem that server ports in Dempsy are ephemeral so if you're not running with a "host" network it wont have the correct port either. Other than making the functionality pluggable/customizable I'm not sure what to do. I'm open to suggestions. Let me know what you think. |
This use case is using host mode, so we make sure that eth0 is the first network gateway listed by brute force at the OS level. Without going into an overly robust networking solution, for this use case simply passing in the network bridge name would work. |
Okay. I'll make the network interface it selects configurable by name. I can have a change up probably later today. It will be on 0.9.1-SNAPSHOT. I'll write tests for it but let me know if it works for you and I'll cut a release with the change. You'll be able to supply the setting in the As an alternative, if you're interested, the 0.9 codebase has the ability to customize the IP address resolution with your own code. See https://github.com/Dempsy/dempsy/blob/0.9/dempsy-framework.core/src/main/java/net/dempsy/transport/tcp/AbstractTcpReceiver.java#L37 . It you're configuring programatically you can just call that on the I'm not sure if you noticed but the documentation is out of date. I've been working on updating it slowly but it's currently referencing 0.8.x and 0.9 was a significant refactor. |
See #90 Let me know if that works for you |
When playing with multiple network gateways this becomes a problem with registering incorrect IP's in zookeeper. (eg can become non-trivial when using multiple gateways with Docker). The default behavior on CentOS with eth0 and docker0 in this case to pick up the docker0 gateway, which may not be what is desired.
The text was updated successfully, but these errors were encountered: