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
Force the name / ipaddress with which Eureka client registers at the server #788
Comments
I think this may be related to #573 |
I think that this is a similar issue and the fix, done by @spencergibb might lead to a workaround, but in my case I have a VPN connection via network interface "ppp2" (ppp[0-9]*) with an IP 10.0.0.0/8 and a local area network with IPs 192.168.0.0/24. The home network is not reachable because the VPN client cuts all routes so that the machine is in the corporate LAN only. In this case I would need a property to specify a NIC name or an order of nic names, something like this: preferredNics=ppp,eth,lo
I'm not sure whether this works for all cases (see the list of interfaces in the ticket Netflix/eureka#737). But setting an IP address or a hostname explicitly works for 127.0.0.1/localhost, i.e. local development only. It does not work if you want yout services to be on the company network, to which you connected via the PPP adapter. |
I had a similar problem where I needed a non-local IP because of port bindiung problems on our teamcity server. I solved that by determining the IP on the outside of the component tests with this groovy script in the pom:
This sets a property which is then passed to the service startscript and the component tests. (In this project, we don't use eureka, so setting the IP works without intereference) You could easily backport this to java code and place it in your main(...) method and set the IP there as soon as the override works. |
AFAIK if you set either the N.B. there is no bean called "springCloudClientHostInfo" (as far as I know), but there is a low-priority |
well #573 was fixed 5 days ago. So this is not released yet, I guess |
OK, let's assume if it works for me that this is a duplicate of #573. |
The solution somehow worked out for me is to use hostname instead of ip fixed to localhost.
.. and ignore network interfaces of the "problematic" uplinks is the cfg like described here at all clients |
You can still use the IP Address, but you need a recent Brixton version for it. For example I had problems with the VPN IP breaking my setup, now I can ignore its interface by:
|
Yes, i have tested with M4. In my case i get it working with (depends on your interfaces names)
|
The issue I have is described here:
Netflix/eureka#737
In Spring Cloud I see several properties where I was hoping to be able to override the hostname or the IP address with which the Spring Cloud Eureka Client registers with the server:
When I set this in the application.yml it still gets overridden by the springCloudClientHostInfo config bean which takes precedence.
The following props do not seem to influence the name/ip being registered.
And the third one was with the metadataMap:
Also without effect.
Is this feature missing from the code or from the documentation only?
The text was updated successfully, but these errors were encountered: