这篇文章将为大家详细讲解有关出现dubbo错误ip及ip乱入问题怎么办,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
问题
在本地启动dubbo时,服务注册在本地的zookeeper ,但是注册IP却不是本地的iP。产生问题,导致consumer 找不到provider ,访问不了服务。
产生原因,随机产生,可能是你重启一下机器,或者电脑小智一段时间就会发生。
com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://100.106.199.34:20880/con.xxxx.xxxx.xxxx.xxxx.NginxLogService?accesslog=./logs/xxxx-xxxx-provider-dubbo.log&anyhost=true&application=xxxx-xxxx&check=false&codec=dubbo&default.accesslog=true&default.check=false&default.delay=-1&default.loadbalance=roundrobin&default.retries=0&default.timeout=60000&delay=-1&dubbo=2.8.4&generic=false&heartbeat=60000&interface=cn.xxxx.xxxx.xxxx.xxxx.NginxLogService&logger=slf4j&methods=getModelPage&organization=xxxx&owner=xxxx&pid=38690&side=consumer×tamp=1545988767460) failed to connect to server /100.106.199.34:20880 client-side timeout 3000ms (elapsed: 3004ms) from netty client 100.106.199.34 using dubbo version 2.8.4 at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:147) 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:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.remoting.RemoteConnectFailureException: Could not connect to remote service [rmi://192.168.72.235:20881/com.ztesoft.zsmartcity.ynzw.demo.service.DemoService]; nested exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.xxx.xxx.service.LoginService. No provider available for the service com.xxxx.xxxx.service.LoginService:3.0 from the url zookeeper://202.106.199.37:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=xxx&application.version=3.0&check=false&default.timeout=5000&dubbo=2.5.3&interface=com.xxx.xxx.service.LoginService&methods=aLogin,bPassword,userLogin,modifyPasswordLogin,validate,fVersion,xLogout,userLogout,getTest,getCode,aLogin,aToken,aUser&pid=2200&revision=1.0&side=consumer×tamp=1462534379328&version=3.0 to the consumer 202.106.199.37 use dubbo version 2.5.3
解决方法
在程序配置文件中 配置dubbo 的注册中心“dubbo.registry.address
” 时要注意不要配置127.0.0.1 要配置为 localhost。
然后在配置本地的/etc/hosts 文件中
127.0.0.1 localhost
问题原因
怀疑原因:为本地配置127.0.0.1 时由于连着网络所以dns 解析解析到了你的网络上了。么有解析到本机造成的。但是并不确定是不是这个原因。
关于出现dubbo错误ip及ip乱入问题怎么办就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。