Dobbo 2.7.6 Failed to check the status of the service **** No provider available for the service **

 

场景:

    spring boot 整合 dubbo 使用Dubbo 2.7.6 ,以zookeeper(zookeeper 部署到远程服务器) 作为注册中心,进行服务提供,消费。在本地进行调用 没有问题。

官方dubbo 整合 spring-boot 地址: https://github.com/apache/dubbo-spring-boot-project

当把 服务提供者放置远程服务器上部署时,把消费者也放置远程服务器上调用没有任何问题。当在本地启动消费者时 `连接上 zookeeper` 但是出现 ,造成服务启动失败。出错信息 Failed to check the status of the service ****  No provider available for the service ** 

出现这种情况是 消费者 和 服务提供者没有建立上联系,没有成功进行交互

解决方法:

 1:  

 提供者 暴露 20880端口,让消费者使用此端口通信. 提供者所在的服务器也必须开放 20880 端口

2:  服务提供方 在使用   @Service(version = "1.0.0") 需要添加 version (这里的版本号需要跟 消费端一致)

3:消费方  @Reference(version = "1.0.0",url = "dubbo://ip:20880") (version 需要跟 提供方保持一致。 ip为提供方所在的服务ip)

然后重启启动提供方,消费方