You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem description
nacos requires that the addresses of multiple registration centers be separated by English commas, and dubbo requires that the addresses of the registration centers be separated by English semicolons; when dubbo uses nacos as the registration center, a WARN error "org.apache" will be reported during the project startup process. .dubbo.config.ServiceConfig.findConfigedHosts"; the reason for this error is that dubbo needs to establish a socket connection with the nacos registration center during the process of exposing the service and use the local address of this connection as the dubbo provider's ip. When parsing the registration center address The following code is used:
The address parsed by this end of the code is "192.168.10.10, 192.168.10.11, 192.168.10.12". When using this address new InetSocketAddress, an error was reported, but a warn log was caught. The specific code is as follows
In this way, in the case of multiple network cards, it is impossible to obtain the correct IP address to expose the service.
2.Exception stack
WARN org.apache.dubbo.config.ServiceConfig.findConfigedHosts:592 - [DUBBO] 192.168.41.3:8848,192.168.41.9:8848,192.168.41.14, dubbo version: 2.7.8, current host: 10.2.19.204
java.net.UnknownHostException: 192.168.41.3:8848,192.168.41.9:8848,192.168.41.14
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:196)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
at org.apache.dubbo.config.ServiceConfig.findConfigedHosts(ServiceConfig.java:588)
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:443)
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:325)
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:300)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:206)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$15(DubboBootstrap.java:1103)
at java.util.HashMap$Values.forEach(HashMap.java:983)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1090)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:901)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:59)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:52)
at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at net.xxx.Xxx.Application.run(XxxSpringApplication.java:40)
at net.xxx.Xxx.Application.run(XxxSpringApplication.java:36)
at com.xxx.Application.main(Application.java:16)
WARN org.apache.dubbo.config.ServiceConfig.findConfigedHosts:592 - [DUBBO] 192.168.41.3:8848,192.168.41.9:8848,192.168.41.14, dubbo version: 2.7.8, current host: 10.2.19.204
java.net.UnknownHostException: 192.168.41.3:8848,192.168.41.9:8848,192.168.41.14
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:196)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
at org.apache.dubbo.config.ServiceConfig.findConfigedHosts(ServiceConfig.java:588)
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:443)
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:325)
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:300)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:206)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$15(DubboBootstrap.java:1103)
at java.util.HashMap$Values.forEach(HashMap.java:983)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1090)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:901)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:59)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:52)
at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at net.xxx.Xxx.Application.run(XxxSpringApplication.java:40)
at net.xxx.Xxx.Application.run(XxxSpringApplication.java:36)
at com.xxx.Application.main(Application.java:16)
Environment
Steps to reproduce this issue
nacos requires that the addresses of multiple registration centers be separated by English commas, and dubbo requires that the addresses of the registration centers be separated by English semicolons; when dubbo uses nacos as the registration center, a WARN error "org.apache" will be reported during the project startup process. .dubbo.config.ServiceConfig.findConfigedHosts"; the reason for this error is that dubbo needs to establish a socket connection with the nacos registration center during the process of exposing the service and use the local address of this connection as the dubbo provider's ip. When parsing the registration center address The following code is used:
The address parsed by this end of the code is "192.168.10.10, 192.168.10.11, 192.168.10.12". When using this address new InetSocketAddress, an error was reported, but a warn log was caught. The specific code is as follows
2.Exception stack
It is recommended that the regular expression in the dubbo parsing registration center be compatible with English commas
nacos要求多个注册中心的地址用英文的逗号分割,dubbo要求注册中心的地址用英文的分号分割;当dubbo用nacos做注册中心时在项目启动过称中会报一个WARN错误 “org.apache.dubbo.config.ServiceConfig.findConfigedHosts”;这个错误产生的原因是dubbo在暴露服务的过程中要和nacos注册中心建立一个socket连接并用这个连接的本地地址作为dubbo提供者的ip,在解析注册中心地址时用到了下面的代码:
这端代码解析出来的address为“192.168.10.10,192.168.10.11,192.168.10.12”,在用这个地址 new InetSocketAddress时报了一个错,但是被catch住打了一个warn日志具体代码快如下
这样在多网卡的情况下就无法获取正确的ip地址暴露服务了。
2.异常堆栈
3.涉及到的类或方法
4.修改建议
建议在dubbo解析注册中心的正则表达式中兼容英文逗号的情况
The text was updated successfully, but these errors were encountered: