欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決dubbo錯(cuò)誤ip及ip亂入問(wèn)題的方法

 更新時(shí)間:2019年03月13日 14:51:30   作者:雙斜杠少年  
今天小編就為大家分享一篇關(guān)于解決dubbo錯(cuò)誤ip及ip亂入問(wèn)題的方法,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧

問(wèn)題

在本地啟動(dòng)dubbo時(shí),服務(wù)注冊(cè)在本地的zookeeper ,但是注冊(cè)IP卻不是本地的iP。產(chǎn)生問(wèn)題,導(dǎo)致consumer 找不到provider ,訪問(wèn)不了服務(wù)。

  • 例如 本地IP為 10.0.0.1 ,但是zookeeper上的注冊(cè)ip 可能是 196.168.0.1

產(chǎn)生原因,隨機(jī)產(chǎn)生,可能是你重啟一下機(jī)器,或者電腦小智一段時(shí)間就會(huì)發(fā)生。

  • 報(bào)錯(cuò)類似
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&timestamp=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 的注冊(cè)中心“dubbo.registry.address” 時(shí)要注意不要配置127.0.0.1 要配置為 localhost。

然后在配置本地的/etc/hosts 文件中

127.0.0.1 localhost

問(wèn)題原因

懷疑原因:為本地配置127.0.0.1 時(shí)由于連著網(wǎng)絡(luò)所以dns 解析解析到了你的網(wǎng)絡(luò)上了。么有解析到本機(jī)造成的。但是并不確定是不是這個(gè)原因。

總結(jié)

以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接

相關(guān)文章

  • spring學(xué)習(xí)之@SessionAttributes實(shí)例解析

    spring學(xué)習(xí)之@SessionAttributes實(shí)例解析

    這篇文章主要介紹了spring學(xué)習(xí)之@SessionAttributes實(shí)例解析,分享了相關(guān)代碼示例,小編覺(jué)得還是挺不錯(cuò)的,具有一定借鑒價(jià)值,需要的朋友可以參考下
    2018-02-02
  • SpringBoot如何獲取客戶端的IP地址

    SpringBoot如何獲取客戶端的IP地址

    這篇文章主要介紹了SpringBoot如何獲取客戶端的IP地址問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-05-05
  • Java中實(shí)現(xiàn)雙數(shù)組Trie樹(shù)實(shí)例

    Java中實(shí)現(xiàn)雙數(shù)組Trie樹(shù)實(shí)例

    這篇文章主要介紹了Java中實(shí)現(xiàn)雙數(shù)組Trie樹(shù)實(shí)例,雙數(shù)組Trie就是一種優(yōu)化了空間的Trie樹(shù),本文給出了實(shí)現(xiàn)代碼、測(cè)試代碼和測(cè)試結(jié)果,需要的朋友可以參考下
    2015-01-01
  • Servlet的線程安全問(wèn)題

    Servlet的線程安全問(wèn)題

    本文主要介紹了Servlet的線程安全問(wèn)題,文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-02-02
  • Java多線程中停止線程遇到線程阻塞的處理方法詳解

    Java多線程中停止線程遇到線程阻塞的處理方法詳解

    這篇文章主要介紹了Java多線程中停止線程遇到線程阻塞的處理方法詳解,在阻塞狀態(tài)下,線程會(huì)釋放CPU資源,從而允許其他線程執(zhí)行,線程阻塞是實(shí)現(xiàn)多線程編程中重要的概念,可以提高程序的效率和資源利用率,需要的朋友可以參考下
    2023-10-10
  • Java中的流式編程問(wèn)題

    Java中的流式編程問(wèn)題

    這篇文章主要介紹了Java中的流式編程問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-12-12
  • Maven本地緩存清理小工具的實(shí)現(xiàn)

    Maven本地緩存清理小工具的實(shí)現(xiàn)

    這篇文章主要介紹了Maven本地緩存清理小工具的實(shí)現(xiàn),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-05-05
  • String s = new String(''a '') 到底產(chǎn)生幾個(gè)對(duì)象

    String s = new String(''a '') 到底產(chǎn)生幾個(gè)對(duì)象

    這篇文章主要介紹了String s = new String(" a ") 到底產(chǎn)生幾個(gè)對(duì)象,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-05-05
  • springboot如何配置定時(shí)任務(wù)

    springboot如何配置定時(shí)任務(wù)

    這篇文章主要介紹了springboot如何配置定時(shí)任務(wù),幫助大家更好的理解和使用springboot框架,感興趣的朋友可以了解下
    2020-11-11
  • Spring?框架中的?Bean?作用域(Scope)使用詳解

    Spring?框架中的?Bean?作用域(Scope)使用詳解

    Spring框架中的Bean作用域(Scope)決定了在應(yīng)用程序中創(chuàng)建和管理的Bean對(duì)象的生命周期和可見(jiàn)性。本文將詳細(xì)介紹Spring框架中的Bean作用域的不同類型,包括Singleton、Prototype、Request、Session和Application,并解釋它們的特點(diǎn)和適用場(chǎng)景。
    2023-09-09

最新評(píng)論