You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "mengshuai85 (GitHub)" <gi...@apache.org> on 2020/03/19 10:51:46 UTC
[GitHub] [dubbo] mengshuai85 opened issue #5888: dubbo注册到nacos,配置的对外ip(DUBBO_IP_TO_REGISTRY)被冲掉了
### Environment
* Dubbo version: 2.6.7
* Operating System version: win10
* Java version: 1.8
### Steps to reproduce this issue
1、java启动业务服务,配置参数 -DDUBBO_IP_TO_REGISTRY=xx.xx.xx.xx
2、启动后注册到nacos的ip地址,是机器本身的地址
3、多网卡情况下,不能配置
### Expected Result
注册到nacos的ip地址,应该是配置的,而非机器随机ip
对应code:
private Instance createInstance(URL url) {
String category = url.getParameter("category", "providers");
URL newURL = url.addParameter("category", category);
newURL = newURL.addParameter("protocol", url.getProtocol());
String ip = NetUtils.getLocalHost(); //???????
int port = newURL.getParameter("bind.port", url.getPort());
Instance instance = new Instance();
instance.setIp(ip);
instance.setPort(port);
instance.setMetadata(new HashMap(newURL.getParameters()));
return instance;
}
[ Full content available at: https://github.com/apache/dubbo/issues/5888 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] xli1224 commented on issue #5888: dubbo注册到nacos,配置的对外ip(DUBBO_IP_TO_REGISTRY)被冲掉了
Posted by "xli1224 (GitHub)" <gi...@apache.org>.
Please try --dubbo.protocol.host=xx.xx.xx.xx
[ Full content available at: https://github.com/apache/dubbo/issues/5888 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] xli1224 commented on issue #5888: dubbo注册到nacos,配置的对外ip(DUBBO_IP_TO_REGISTRY)被冲掉了
Posted by "xli1224 (GitHub)" <gi...@apache.org>.
> > Please try --dubbo.protocol.host=xx.xx.xx.xx
>
> this way is not available,my server ip is LAN IP,and resistry ip is Internet IP,if set the host,the service can't startup,
> show ip bind error
Tried DUBBO_IP_TO_REGISTRY on my laptop, it worked. Please make sure your system property placed before your '-jar' option
`java -DDUBBO_IP_TO_REGISTRY=192.168.50.22 -jar dubbo-greeting-service-0.0.1-SNAPSHOT.jar`
[ Full content available at: https://github.com/apache/dubbo/issues/5888 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org