You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/07/27 07:43:18 UTC

[GitHub] [dubbo] zhaoqf-cq opened a new issue, #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

zhaoqf-cq opened a new issue, #10374:
URL: https://github.com/apache/dubbo/issues/10374

   我用的 dubbo3.0.7,参考 https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-kubernetes 这个 demo 创建的spring boot 应用,运行一切正常
   
   由于服务可能比较多, 我不太想 像 demo 里面一个个订阅服务 subscribed-services=dubbo-samples-apiserver-provider, 所以我取消了这个配置, 项目依旧可以运行, 但是我不太明白这个地址的配置能有那些, 取消了这个订阅有什么影响?
   
   dubbo.registry.address=kubernetes://DEFAULT_MASTER_HOST?registry-type=service&duplicate=false&namespace=dubbo-demo&trustCerts=true&subscribed-services=dubbo-samples-apiserver-provider
   
   然后在消费接口这里使用的是  @DubboReference(version = "1.0.0", providedBy = "dubbo-samples-apiserver-provider") 这样来引用接口,这里为什么需要声明应用呢? 而且我尝试过不声明应用启动就会提示 没有服务提供者 导致启动失败,如果一个个加providedby, 就显得有点傻
   
   
   求大佬解惑!!!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by "zhaoqf-cq (via GitHub)" <gi...@apache.org>.
zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者
URL: https://github.com/apache/dubbo/issues/10374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference  providedby 不配置 提示没有服务提供者
URL: https://github.com/apache/dubbo/issues/10374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1316573166

   > 作为一个使用思维感觉上提个自己的建议,在消费者端指定providedBy没有在服务提供者端指定好,毕竟服务提供者是最知道自己的应用名的,所以可以在暴露出来的interface上带上这个应用名信息,小建议
   
   一个不错的提议,或许我们可以调研下怎么支持


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhaoqf-cq commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
zhaoqf-cq commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1196801258

   > 这里需要一个服务映射的功能。 因为dubbo本身是没法在消费端侧知道interface对应的appName是什么,在 Kubernetes 体系下,Service 对应的是 appName,没有 appName 就没法做订阅,所以才有了 providedBy 这个参数。 对于一些其他注册中心下的,比如 nacos 默认会开启元数据中心,元数据中心中会存有一份 interface to appName 的映射,所以不需要配 providedBy 参数。但是 Kubernetes 原生体系下没有这个元数据中心。
   
   感谢大佬解惑,看到回复还第一时间试过 单独配置一个 元数据中心,居然真的可以... 惊喜, 非常感激


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者
URL: https://github.com/apache/dubbo/issues/10374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
zhaoqf-cq closed issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者
URL: https://github.com/apache/dubbo/issues/10374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1196494424

   这里需要一个服务映射的功能。
   因为dubbo本身是没法在消费端侧知道interface对应的appName是什么,在 Kubernetes 体系下,Service 对应的是 appName,没有 appName 就没法做订阅,所以才有了 providedBy 这个参数。
   对于一些其他注册中心下的,比如 nacos 默认会开启元数据中心,元数据中心中会存有一份 interface to appName 的映射,所以不需要配 providedBy 参数。但是 Kubernetes 原生体系下没有这个元数据中心。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zzps commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
zzps commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1314719411

   > 这里需要一个服务映射的功能。 因为dubbo本身是没法在消费端侧知道interface对应的appName是什么,在 Kubernetes 体系下,Service 对应的是 appName,没有 appName 就没法做订阅,所以才有了 providedBy 这个参数。 对于一些其他注册中心下的,比如 nacos 默认会开启元数据中心,元数据中心中会存有一份 interface to appName 的映射,所以不需要配 providedBy 参数。但是 Kubernetes 原生体系下没有这个元数据中心。
   
   作为一个使用思维感觉上提个自己的建议,在消费者端指定providedBy没有在服务提供者端指定好,毕竟服务提供者是最知道自己的应用名的,所以可以在暴露出来的interface上带上这个应用名信息,小建议


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] aamingaa commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by "aamingaa (via GitHub)" <gi...@apache.org>.
aamingaa commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1407638355

   look at this https://github.com/apache/dubbo/pull/11390


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhaoqf-cq commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
zhaoqf-cq commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1197576728

   @AlbumenJ 大佬, 我昨天添加了 zk 作为 dubbo 元数据中心的依赖,使用也正常...
   `
   dubbo.metadata-report.address=zookeeper://ip:port
   <dependency>
       <groupId>org.apache.dubbo</groupId>
       <artifactId>dubbo-metadata-report-zookeeper</artifactId>
   </dependency>`
   但是我刚刚尝试将元数据中心换成 redis,consumer 启动的时候就提示  no provider... 请问这是为什么呢?
   `dubbo.metadata-report.address=redis://ip:port
   <dependency>
       <groupId>org.apache.dubbo</groupId>
       <artifactId>dubbo-metadata-report-redis</artifactId>
   </dependency>`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] robberphex commented on issue #10374: dubbo 使用 k8s 为注册中心, 消费者@DubboReference providedby 不配置 提示没有服务提供者

Posted by GitBox <gi...@apache.org>.
robberphex commented on issue #10374:
URL: https://github.com/apache/dubbo/issues/10374#issuecomment-1350825641

   现在的搞法是:
   ```java
   public interface GreetingService {
       String sayHello(String name);
   }
   
   @Component("annotatedConsumer")
   public class GreetingServiceConsumer {
       @DubboReference(version = "1.0.0", providedBy = "dubbo-samples-xds-provider")
       private GreetingService greetingService;
   }
   ```
   "在消费者端指定providedBy没有在服务提供者端指定好,毕竟服务提供者是最知道自己的应用名的,所以可以在暴露出来的interface上带上这个应用名信息",我觉得这样是比较ok的。
   代码上可以改成这样:
   ```java
   @DubboProvidedbBy("dubbo-samples-xds-provider")
   public interface GreetingService {
       String sayHello(String name);
   }
   
   @Component("annotatedConsumer")
   public class GreetingServiceConsumer {
       @DubboReference(version = "1.0.0")
       private GreetingService greetingService;
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org