原创

搭建dubbo服务框架时,提供者ip错误

DUBBO是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,是阿里巴巴SOA服务化治理方案的核心框架,每天为2,000+个服务提供3,000,000,000+次访问量支持,并被广泛应用于阿里巴巴集团的各成员站点。

dubbo获取的ip错误后,程序报如下异常:

2016-06-03 19:25:56,268 WARN [com.alibaba.dubbo.remoting.transport.AbstractClient] -  [DUBBO] client reconnect to 10.174.246.27:20885 find error . url: dubbo://10.174.246.27:20885/com.soft.portal.service.api.IPortal?anyhost=true&application=ecs-sale-service&check=false&codec=dubbo&dubbo=2.5.4-SNAPSHOT&generic=false&heartbeat=60000&interface=com.soft.portal.service.api.IPortal&loadbalance=roundrobin&methods=ruleengine,cover,initDownload,underwriting&pid=3724&revision=1.0.1-SNAPSHOT&side=consumer&timeout=100000&timestamp=1464953149151, dubbo version: 2.5.3, current host: 192.168.0.119
com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://10.174.246.27:20885/com.soft.portal.service.api.IPortal?anyhost=true&application=ecs-sale-service&check=false&codec=dubbo&dubbo=2.5.4-SNAPSHOT&generic=false&heartbeat=60000&interface=com.soft.portal.service.api.IPortal&loadbalance=roundrobin&methods=ruleengine,cover,initDownload,underwriting&pid=3724&revision=1.0.1-SNAPSHOT&side=consumer&timeout=100000&timestamp=1464953149151) failed to connect to server /10.174.246.27:20885 client-side timeout 3000ms (elapsed: 3002ms) from netty client 192.168.0.119 using dubbo version 2.5.3
	at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:127)
	at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:280)
	at com.alibaba.dubbo.remoting.transport.AbstractClient$1.run(AbstractClient.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:662)
ccc2016-06-03 19:40:52,395 ERROR [com.alibaba.dubbo.remoting.transport.AbstractClient] -  [DUBBO] client reconnect to 10.174.246.27:20885 find error . url: dubbo://10.174.246.27:20885/com.soft.portal.service.api.IPortal?anyhost=true&application=ecs-sale-service&check=false&codec=dubbo&dubbo=2.5.4-SNAPSHOT&generic=false&heartbeat=60000&interface=com.soft.portal.service.api.IPortal&loadbalance=roundrobin&methods=ruleengine,cover,initDownload,underwriting&pid=3724&revision=1.0.1-SNAPSHOT&side=consumer&timeout=100000&timestamp=1464953149151, dubbo version: 2.5.3, current host: 192.168.0.119
com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://10.174.246.27:20885/com.soft.portal.service.api.IPortal?anyhost=true&application=ecs-sale-service&check=false&codec=dubbo&dubbo=2.5.4-SNAPSHOT&generic=false&heartbeat=60000&interface=com.soft.portal.service.api.IPortal&loadbalance=roundrobin&methods=ruleengine,cover,initDownload,underwriting&pid=3724&revision=1.0.1-SNAPSHOT&side=consumer&timeout=100000&timestamp=1464953149151) failed to connect to server /10.174.246.27:20885 client-side timeout 3000ms (elapsed: 3003ms) from netty client 192.168.0.119 using dubbo version 2.5.3
	at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:127)
	at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:280)
	at com.alibaba.dubbo.remoting.transport.AbstractClient$1.run(AbstractClient.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:662)

在 dubbo.properties 配置文件中增加 dubbo.protocol.host=192.168.0.123,问题即可解决。

~阅读全文~人机检测~

关注下方微信公众号“Java精选”(w_z90110),回复关键词领取资料:如Mysql、Hadoop、Dubbo、Spring Boot等,免费领取视频教程、资料文档和项目源码。

Java精选专注程序员推送一些Java开发知识,包括基础知识、各大流行框架(Mybatis、Spring、Spring Boot等)、大数据技术(Storm、Hadoop、MapReduce、Spark等)、数据库(Mysql、Oracle、NoSQL等)、算法与数据结构、面试专题、面试技巧经验、职业规划以及优质开源项目等。其中一部分由小编总结整理,另一部分来源于网络上优质资源,希望对大家的学习和工作有所帮助。

评论

分享:

支付宝

微信