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

Optimization of IP address acquisition method #6160

Closed
bdqfork opened this issue Jun 25, 2021 · 0 comments
Closed

Optimization of IP address acquisition method #6160

bdqfork opened this issue Jun 25, 2021 · 0 comments
Labels
area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement.
Milestone

Comments

@bdqfork
Copy link
Contributor

bdqfork commented Jun 25, 2021

Is your feature request related to a problem? Please describe.
Currently, in the NetUtils.localIP() method, the IP address is set by specifying the com.alibaba.nacos.client.naming.local.ip parameter. However, the NetUtils.localIP() method is used in the config module and naming module, even in the connection layer. Therefore, I think this parameter name is unsuitable. In addition, if you want to use the hostname instead of IP for config publishing, it is not very convenient at present. You need to specify the com.alibaba.nacos.client.naming.local.ip parameter as the hostname, not automatic discovery.

Describe the solution you'd like
I think the com.alibaba.nacos.client.naming.local.ip parameter should be changed to com.alibaba.nacos.client.local.ip, and a com.alibaba.nacos.client.preferHostname parameter should be provided to specify that IP is preferred to be replaced by hostname for config publishing. If you agree with this, I can provide PR.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@KomachiSion KomachiSion added kind/enhancement Category issues or prs related to enhancement. area/Client Related to Nacos Client SDK labels Jun 25, 2021
KomachiSion pushed a commit that referenced this issue Jul 14, 2021
* [ISSUE #6160] Optimization of IP address acquisition method

* add test case and fix bug

* perform the cleanup operation after the method
@KomachiSion KomachiSion added this to the 2.0.3 milestone Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants