dubbo admin 爲什麼會出現IP 爲 127.0.0.1 的提供者

dubbo報錯
2020-05-14 11:45:54.383 ERROR 11066 --- [dubbo-client-idleCheck-thread-1] o.a.d.r.e.s.h.ReconnectTimerTask         51  :  [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.10.30.222:0 -> /127.0.0.1:39871]], dubbo version: , current host:10.10.30.222 org.apache.dubbo.remoting.RemotingException: client(url: dubbo://127.0.0.1:39871/com.xxx.service?accesslog=false&actives=200&anyhost=true&application=xxx-api&async=true&bean.name=com.service.SearchService&charset=UTF-8&check=false&codec=dubbo&default.deprecated=false&default.dynamic=true&default.lazy=false&default.register=true&default.sticky=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&heartbeat=60000&interface=com.xxx.service&iothreads=25&lazy=false&loadbalance=leastactive&logger=slf4j&methods=getxxx,getxxx2&organization=xxx&owner=xxx&payload=88388608&pid=11066&register=true&register.ip=xx&remote.application=xxxx&remote.timestamp=1589421803156&retries=0&serialization=protostuff&server=netty&side=consumer&sticky=false&timeout=300&timestamp=1589422952724) failed to connect to server /127.0.0.1:39871, error message is:Connection refused: /xxx.xx.xx.xxx:39871
        at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:131)
        at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:186)
        at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:242)
        at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:152)
        at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
        at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
        at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
        at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
        at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
        at java.lang.Thread.run(Thread.java:748)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /10.13.30.241:39871
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:346)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:639)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:574)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:488)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:450)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
        ... 1 more
排查

發現dubbo admin
在這裏插入圖片描述
因爲這個環境只有兩臺provider,所以,登錄到另一臺執行如下命令:

cat /etc/hostname 

zzf

cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 zzf

解決

1、將zzf從hosts中刪除
2、將zzf從hosts中刪除,並添加一行指定ip爲本機真實ip

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章