You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "nemowang (via GitHub)" <gi...@apache.org> on 2023/03/01 16:54:53 UTC

[GitHub] [dubbo] nemowang opened a new issue, #11701: 建立连接的端口不是配置文件中指定的端口

nemowang opened a new issue, #11701:
URL: https://github.com/apache/dubbo/issues/11701

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ## Ask your question here
   consumer配置指定dubbo端口是7001,provider配置指定的dubbo端口是5001,<br>
   但是建立连接时却是:The connection of /192.168.0.109:**51490** -> /192.168.0.109:5001 is established,<br>
   导致调用接口时报No provider异常。
   其中这个5位数的端口不是配置指定的,而且每次重启会改变。
   
   - Dubbo version: 2.7.8
   - Java version: 1.8
   
   服务启动顺序:先启动consumer,再启动provider。
   provider启动完成时**consumer**打出来的日志:
   ```log
   2023-03-02 00:35:55.615  INFO 20228 --- [ncesChangeEvent] a.DubboServiceDiscoveryAutoConfiguration : The event of the service instances[name : ds-service , size : 1] change is about to be dispatched
   2023-03-02 00:35:55.616  WARN 20228 --- [ncesChangeEvent] c.a.c.dubbo.registry.DubboCloudRegistry  : APP ds-service instance changed, size changed zero!!!
   2023-03-02 00:35:58.802  INFO 20228 --- [ncesChangeEvent] a.DubboServiceDiscoveryAutoConfiguration : The event of the service instances[name : ds-service , size : 1] change is about to be dispatched
   2023-03-02 00:35:58.802  INFO 20228 --- [ncesChangeEvent] c.a.c.dubbo.registry.DubboCloudRegistry  : APP ds-service instance changed, size changed to 1
   2023-03-02 00:35:58.802  WARN 20228 --- [ncesChangeEvent] c.a.c.dubbo.registry.DubboCloudRegistry  : Subscription app ds-service, can't find metadata handler
   2023-03-02 00:35:58.804  INFO 20228 --- [ncesChangeEvent] c.a.c.d.s.DubboMetadataServiceProxy      : The metadata of Dubbo service[name : ds-service] is about to be initialized
   2023-03-02 00:35:58.807  INFO 20228 --- [ncesChangeEvent] c.a.c.dubbo.registry.DubboCloudRegistry  :  [DUBBO] Register: consumer://192.168.187.1/org.apache.dubbo.rpc.service.GenericService?application=ds-web&category=consumers&check=false&dubbo=2.0.2&generic=true&group=ds-service&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&pid=20228&qos.enable=false&release=2.7.8&retries=0&router=-default,revisionRouter&side=consumer&sticky=false&timeout=10000&timestamp=1677688558806&version=1.0.0, dubbo version: 2.7.8, current host: 192.168.187.1
   2023-03-02 00:35:58.808  INFO 20228 --- [ncesChangeEvent] c.a.c.dubbo.registry.DubboCloudRegistry  :  [DUBBO] Subscribe: consumer://192.168.187.1/org.apache.dubbo.rpc.service.GenericService?application=ds-web&category=providers,configurators,routers&check=false&dubbo=2.0.2&generic=true&group=ds-service&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&pid=20228&qos.enable=false&release=2.7.8&retries=0&router=-default,revisionRouter&side=consumer&sticky=false&timeout=10000&timestamp=1677688558806&version=1.0.0, dubbo version: 2.7.8, current host: 192.168.187.1
   2023-03-02 00:35:58.843  INFO 20228 --- [lientWorker-4-1] o.a.d.r.t.netty4.NettyClientHandler      :  [DUBBO] The connection of /192.168.0.109:51490 -> /192.168.0.109:5001 is established., dubbo version: 2.7.8, current host: 192.168.187.1
   2023-03-02 00:35:58.849  INFO 20228 --- [ncesChangeEvent] o.a.d.remoting.transport.AbstractClient  :  [DUBBO] Successed connect to server /192.168.0.109:5001 from NettyClient 192.168.187.1 using dubbo version 2.7.8, channel is NettyChannel [channel=[id: 0xa98087e1, L:/192.168.0.109:51490 - R:/192.168.0.109:5001]], dubbo version: 2.7.8, current host: 192.168.187.1
   2023-03-02 00:35:58.849  INFO 20228 --- [ncesChangeEvent] o.a.d.remoting.transport.AbstractClient  :  [DUBBO] Start NettyClient /192.168.187.1 connect to the server /192.168.0.109:5001, dubbo version: 2.7.8, current host: 192.168.187.1
   2023-03-02 00:35:58.855  INFO 20228 --- [ncesChangeEvent] org.apache.dubbo.config.ReferenceConfig  :  [DUBBO] Refer dubbo service org.apache.dubbo.rpc.service.GenericService from url spring-cloud://192.168.187.128:9090/org.apache.dubbo.registry.RegistryService?anyhost=true&application=ds-web&bind.ip=192.168.0.109&bind.port=5001&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=true&group=ds-service&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&payload=102400000&pid=20228&qos.enable=false&register.ip=192.168.187.1&release=2.7.8&remote.application=ds-service&retries=0&revision=2.2.6.RELEASE&router=-default,revisionRouter&sca_revision=0&side=consumer&sticky=false&timeout=10000&timestamp=1677688558806&version=1.0.0, dubbo version: 2.7.8, current host: 192.168.187.1
   ```
   **provider**最后一行日志:
   ```log
   2023-03-02 00:35:58.858  INFO 15492 --- [erverWorker-3-1] o.a.d.r.t.netty4.NettyServerHandler      :  [DUBBO] The connection of /192.168.0.109:51490 -> /192.168.0.109:5001 is established., dubbo version: 2.7.8, current host: 192.168.187.1
   ```
   
   **consumer**的配置:
   ```yaml
   dubbo:
     protocol:
       name: dubbo
       payload: 102400000
       port: 7001
     registry:
       address: spring-cloud://192.168.187.128
     cloud:
       subscribed-services: ds-service
     consumer:
       check: false
       retries: 0
       timeout: 10000
     application:
       name: ds-web
   ```
   **provider**的配置:
   ```yaml
   dubbo:
     scan:
       base-package: com.demo.dsservice
     protocol:
       name: dubbo
       payload: 102400000
       port: 5001
     registry:
       address: spring-cloud://192.168.187.128
     cloud:
       subscribed-services: 
     consumer:
       check: false
       timeout: 10000
     application:
       name: ds-service
   ```


-- 
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] MartinDai commented on issue #11701: 建立连接的端口不是配置文件中指定的端口

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

   dubbo的端口配置是用于对外暴露服务,供consumer使用的,你consumer端配置的端口也只是用于给别人调用你的consumer提供的dubbo服务用的,作为consumer调用provider服务使用的端口是不能指定的,就好像你使用httpclient去调用一个80端口的服务,你是不能控制client使用用哪个端口发送数据的


-- 
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] nemowang commented on issue #11701: 建立连接的端口不是配置文件中指定的端口

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

   
   
   
   
   > @nemowang dubbo的端口配置是用于对外暴露服务,供consumer使用的,你consumer端配置的端口也只是用于给别人调用你的consumer提供的dubbo服务用的,作为consumer调用provider服务使用的端口是不能指定的,就好像你使用httpclient去调用一个80端口的服务,你是不能控制client使用哪个端口发送数据的
   
   了解,那我的问题应该跟这个端口没有关系,感谢。


-- 
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] nemowang closed issue #11701: 建立连接的端口不是配置文件中指定的端口

Posted by "nemowang (via GitHub)" <gi...@apache.org>.
nemowang closed issue #11701: 建立连接的端口不是配置文件中指定的端口
URL: https://github.com/apache/dubbo/issues/11701


-- 
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