本地启动项目dubbo服务报错---org.apache.dubbo.remoting.RemotingException: client(url: dubbo://192.168.56.1:2088


org.apache.dubbo.remoting.RemotingException: client(url: dubbo://192.168.56.1:20883/com.test.dubbo.dubbo.StorageDubboService
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:745)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /192.168.56.1:20883
Caused by: java.net.ConnectException: Connection refused: no further information

今天在调试本地的一个dubbo项目报如上错误,查了网上的答案,有俩个解决方案如下:

     1、将启动配置的dubbo的host改为你本机网卡的ip(有一点需要注意,可能某些朋友有好几个适配器网络ip(比如连接了无线),那此时报错信息中还会包含你的无线地址ip的一个同样的报错,但是假如你的生产者和消费者都在同一台设备调试,是不影响注册调用的)

 2、在配置文件(yml或properties)配置如下:

dubbo.protocol.host=192.168.56.1 

需要注意的是消费者和生产者的配置都要加上!!