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

How to set hostname for eureka-client? #836

Closed
silentAllay opened this issue Sep 1, 2016 · 10 comments
Closed

How to set hostname for eureka-client? #836

silentAllay opened this issue Sep 1, 2016 · 10 comments
Labels

Comments

@silentAllay
Copy link

How to set hostname for eureka-client which is registered in eureka-server?

@qiangdavidliu
Copy link
Contributor

Hi @killjason the hostname should be automatically discovered by eureka-client.

@silentAllay
Copy link
Author

@qiangdavidliu, what about the IP address?

@qiangdavidliu
Copy link
Contributor

@killjason same for ip address as well. The client auto detects your hostname and IP via standard system calls, and then (optionally, if in EC2) overlays these with data retrieved from calling the ec2 instance metadata url.

@silentAllay
Copy link
Author

@qiangdavidliu,what if the server have multi network interfaces?

@qiangdavidliu
Copy link
Contributor

@killjason we don't yet support multiple interfaces.

@silentAllay
Copy link
Author

How does eureka-client decide which ip should use if have two interfaces?

@qiangdavidliu
Copy link
Contributor

@killjason if the server is running on Amazon, it defaults to eth0. Otherwise, the default interface is whatever will be picked up by InetAddress.getLocalHost().

@rfoltyns
Copy link

@killjason You can pass your own implementation of PropertiesInstanceConfig to the ApplicationManager. This implementation can override getHostName() and getIpAddress() in a way you want.

@silentAllay
Copy link
Author

@rfoltyns , I extends com.netflix.appinfo.MyDataCenterInstanceConfig to override getHostName() and getIpAddress(), is that OK?

@rfoltyns
Copy link

@killjason yeah, MyDataCenterInstanceConfig also extends this class

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

3 participants