Dubbo注册失败问题定位

项目场景:

Dubbo消费者注册失败


问题描述

一大早到公司,就收到运维的消息,服务器cpu飙升,看日志发下报如下错误:

Caused by: org.apache.dubbo.rpc.RpcException: Failed to invoke the method getAllCustomLogCrawlInfos in the service 
com.oppo.moa.facade.service.CustomLogCrawlService. Tried 3 times of the providers [*] (2/2) from the registry * 
on the consumer * using the dubbo version 2.7.3. Last error is: Failed to invoke remote method: *


Caused by: org.apache.dubbo.remoting.RemotingException: message can not send, 
because channel is closed ....

原因分析:

先去百度,结果都是说2.7.1版本的bug,需要配置
dubbo.provider.dynamic=true

但是我的是2.7.3,已经不存在这个问题,并且看到配置中心有这个配置,对比代码如下

//public abstract class AbstractServiceConfig

-- dubbo-2.7.3
Whether to register as a dynamic service or not on register center, the value is true, the status will be enabled after the service registered,and it needs to be disabled manually; if you want to disable the service, you also need manual processing.
(baidu翻译:是否在注册中心注册为动态服务,值为true,服务注册后状态为启用,需要手动禁用;如果要禁用该服务,还需要手动处理。)
protected Boolean dynamic = true;

-- dubbo-2.7.1
Whether to register as a dynamic service or not on register center, it the value is false, the status will be disabled after the service registered,and it needs to be enabled manually; if you want to disable the service, you also need manual processing.
(baidu翻译:是否在注册中心注册为动态服务,如果值为false,则服务注册后状态为禁用,需要手动启用;如果要禁用该服务,还需要手动处理。)
protected Boolean dynamic = false;

消费者回滚也没效果,就分析是不是生产者有问题,结果发现生产者的配置中,6月份添加了分组配置:
dubbo.provider.group=prod
但是消费者没有添加这个配置,导致消费者一直是在无分组里面进行注册,一直无法注册服务。


解决方案:

无法注册的消费者也添加分组,然后重新部署服务即可
dubbo.provider.group=prod

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值