You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "lexburner (GitHub)" <gi...@apache.org> on 2019/04/09 06:58:11 UTC

[GitHub] [incubator-dubbo] lexburner opened pull request #3834: add a switch to control whether to prefer to register public address or site local address

## What is the purpose of the change

fix the issue: https://github.com/apache/incubator-dubbo/issues/3802
improve the existing changes: https://github.com/apache/incubator-dubbo/pull/3520

## Brief changelog

- add a switch `dubbo.prefer.public.address`.
- change the strategy to achieve IP address.

steps to achieve IP:

1. judge the switch `dubbo.prefer.public.address`
2. search from hosts mapping using `InetAddress.getLocalHost()`
3. search from the network cards using `NetworkInterface.getNetworkInterfaces()`
4. if the address achieved in 2 & 3 not match the `dubbo.prefer.public.address`, downgrade to the reverse property of `dubbo.prefer.public.address`. In words, if no public address found, downgrade to site-local address; if no site-local address found, downgrade to public address;
5. if no address found, using loopback address 127.0.0.1. 


[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3834 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org