You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "evancyz (GitHub)" <gi...@apache.org> on 2019/08/18 04:41:10 UTC

[GitHub] [dubbo] evancyz opened issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

hello,我使用Nacos作为注册中心

我注册了一个服务,这个服务没有配置group,在Nacos后台服务列表的URL是这样

服务注册: providers:com.xxx.api.service.xxxService:1.0.0
服务消费: consumers:com.xxx..api.service.xxxService:1.0.0:

![image](https://user-images.githubusercontent.com/22286097/63220180-dbf43700-c1b4-11e9-9837-48d06c0c5949.png)

消费者后面多了一个 :,导致服务匹配不上

看起来是由于 2.7.3  版本 配置中心 重构导致的,从dubbo的这个Test上来看,这个是符合预期的吗?

```
 org.apache.dubbo.common.URLTest

@Test
    public void testGetColonSeparatedKey() {
        URL url1 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group&version=1.0.0");
        Assertions.assertEquals("org.apache.dubbo.test.interfaceName:1.0.0:group", url1.getColonSeparatedKey());

        URL url2 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&version=1.0.0");
        Assertions.assertEquals("org.apache.dubbo.test.interfaceName:1.0.0:", url2.getColonSeparatedKey());

        URL url3 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group");
        Assertions.assertEquals("org.apache.dubbo.test.interfaceName::group", url3.getColonSeparatedKey());

        URL url4 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName");
        Assertions.assertEquals("org.apache.dubbo.test.interfaceName::", url4.getColonSeparatedKey());
    }
```
我给 `nacos` 和 `nacos-sync`项目都提了issue,不知道是谁的锅

nacos:alibaba/nacos#1712
nacos-sync:https://github.com/nacos-group/nacos-sync/issues/100

[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] evancyz commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "evancyz (GitHub)" <gi...@apache.org>.
我们线上的服务 group都是空的,
看起来  现在的dubbo release版本,都没有修复这个问题
除了魔改一把,不然nacos上不了了


[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] evancyz commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "evancyz (GitHub)" <gi...@apache.org>.
没人回复嘛。。。

[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] complone commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "complone (GitHub)" <gi...@apache.org>.
> > 我们线上的服务 group都是空的,
> > 看起来 现在的dubbo release版本,都没有修复这个问题
> > 除了魔改一把,不然nacos上不了了
> 
> 你们2.7.3之前用的是nacos作注册中心吗?有这个问题吗

我想在这里看起来是必须要配置的

![index](https://user-images.githubusercontent.com/20021404/63245536-04526300-c293-11e9-8ccc-b48c0d334238.png)


[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] evancyz commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "evancyz (GitHub)" <gi...@apache.org>.
后来想了个方案 像zk里注册了两个服务:
```
       <dubbo:service interface="com.xxx.xx.api.service.XXXService" ref="xxxx" version="1.0.0"/>
       <dubbo:service interface="com.xxx.xx.api.service.XXXService" ref="xxxx" version="1.0.0" group="test"/>
```
在 zk 的 注册那边 注册的是两个服务
```
dubbo://10.xx.218.7:20779/com.xx.xx.api.service.XXService?xxx
dubbo://10.xx.218.7:20779/com.xx.xx.api.service.XXService2?xxx&group=test

```

然后用 `nacos-sync` 做同步的时候,都是ok的
项目启动的check也是ok的


可是调用的时候,用test的那个group,就报错了。估计也是服务重了,内部名字没匹配,绝望了,都是bug。。感觉不是很想用nacos的注册中心了

```
com.alibaba.dubbo.remoting.RemotingException: Not found exported service: test/com.xx.api.service.XXService:1.0.0:20779 in [test/com.piaoniu.xx.api.service.XXService2:1.0.0:20779, com.xx..api.service.XXService:1.0.0:20779], may be version or group mismatch 
```










[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] tswstarplanet commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
> 2.7.4-SNAPSHOT 没有 release 吧 ? 能在生产上用么

不建议上生产

[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] tswstarplanet commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
我在2.7.4-SNAPSHOT上试了一下,没有问题,你可以试一下

[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] tswstarplanet commented on issue #4864: 2.7.3 使用Nacos作为服务中心的时候,服务如果没有配置group,会导致服务发现失败

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
> 我们线上的服务 group都是空的,
> 看起来 现在的dubbo release版本,都没有修复这个问题
> 除了魔改一把,不然nacos上不了了

你们2.7.3之前用的是nacos作注册中心吗?有这个问题吗

[ Full content available at: https://github.com/apache/dubbo/issues/4864 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org