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 2018/10/18 03:01:54 UTC

[GitHub] [incubator-dubbo] lexburner commented on issue #2648: Service export IP in multiple network card machine.

This kind of issue is duplicate. You can search the issues of this repository. 
In my opinion, multi-network cards are really hard to choose, the logic of return `InetAddress` in dubbo depends on **hostname firstly**.
so make sure your available IP, and look up your hostname(you can use the command `hostname` in Mac, Linux, Windows).
configure them in your `hosts` file like this:
```
1.2.3.4 xujingfengdeMacBook-Pro.local
```
`1.2.3.4` is what you really want to register in the registry.

Source code can tell you more details about the logic of choosing `InetAddress`, pls debug into `org.apache.dubbo.common.utils.NetUtils.getLocalAddress()`.

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