dubboエラーip及びip乱入問題を解決する方法


問題
ローカルでdubboを起動する時、サービスはローカルのzookeeperに登録しますが、登録IPはローカルのiPではありません。問題が発生し、consumerがproviderを見つけられなくなり、サービスにアクセスできなくなりました。
  • は、例えばローカルIPが10.0.0.1であるが、zookeeper上の登録ipは196.168.0.1
  • である可能性がある。
    原因を発生して、ランダムに発生して、あなたが機械を再起動するか、あるいはコンピュータのサトシがしばらくの間発生するかもしれません。
  • のエラーは
  • のようです。
    
    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
    解決方法
    プログラム構成ファイルにDubbの登録センター「dubbo.registry.address」を配置する場合、127..0.1を配置しないように注意してください。
    ローカルの設定/etc/hostsファイルで
    127..0.1 local host
    問題の原因
    疑いの原因:ローカル設定のために127.1.0.1時にネットワークに接続されているのでdns解析があなたのネットワークに解析されました。本機による解析はありませんでした。しかし、この原因があるかどうかは分かりません。
    締め括りをつける
    以上はこの文章の全部の内容です。本文の内容は皆さんの学習や仕事に対して一定の参考学習価値を持ってほしいです。ありがとうございます。もっと知りたいなら、下のリンクを見てください。