dubbo multicast 连接失败解决方案

一、异常信息

Exception in thread “main” com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service com.demo.service.DemoService. No provider available for the service com.demo.service.DemoService:1.0 from registry 224.5.6.7:1234 on the consumer 10.10.10.1 using the dubbo version 2.5.3. Please check if the providers have been started and registered.

Exception in thread "main" com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service com.demo.service.DemoService. No provider available for the service com.demo.service.DemoService:1.0 from registry 224.5.6.7:1234 on the consumer 10.10.10.1 using the dubbo version 2.5.3. Please check if the providers have been started and registered.
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:246)
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:55)
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:227)
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72)
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
	at com.alibaba.dubbo.common.bytecode.proxy0.sayHello(proxy0.java)
	at com.demo.consumer.Consumer.main(Consumer.java:21)

二、异常原因以及解决方案

**原因一:**使用端和广播端的xxxService类名以及路径不匹配

<!-- 广播端:xxxService 以及 version 必须与使用端一致-->
<dubbo:service interface="com.demo.service.DemoService" ref="demoService" version="1.0"/>
<!-- 使用端:xxxService 以及 version 必须与广播端一致-->
<dubbo:reference id="demoService" check="false" interface="com.demo.service.DemoService" version="1.0"/>

**原因二:**使用端和广播端的广播地址不匹配

<!-- 广播端:使用 multicast 广播注册中心暴露服务地址 (224.0.0.0 - 239.255.255.255) -->
<dubbo:registry address="multicast://224.5.6.7:1234?unicast=false"/>
<!-- 使用端:配置服务注册中心,必须有广播端一致 -->
<dubbo:registry address="multicast://224.5.6.7:1234?unicast=false"/>

**原因三:**该地址在网络中已被占用;改用其他地址(224.0.0.0-239.255.255.255之间)

**注:**如果还不好用,可以直接改成直连

<!-- 广播端:直连模式 -->
<dubbo:registry address="N/A"/>
<!-- 使用端:直连模式 在 dubbo:reference中 加上url="dubbo://127.0.0.1:20880" -->
<dubbo:reference id="demoService" check="false" interface="com.demo.service.DemoService" version="1.0" url="dubbo://127.0.0.1:20880"/>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值