apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.5k stars 26.43k forks source link

关于 @DubboReference 注解中不配置URL问题 #8225

Closed gang0713 closed 3 years ago

gang0713 commented 3 years ago

Dubbo版本2.7.7和3.0.0都有这个问题。 目前发现DubboReference注解中不增加URL并指定IP和端口,消费端就无法访问生产端。提示生产端不存在或是列入了黑名单 1、如果要在URL中指定IP和端口,对于增加生产端的灵活性是不是就降底,对于消费端来说应该是透明的。 2、在application.yml配置文件中是否有什么特别的配置可以去掉DubboReference中的url配置 @DubboReference(version = "${platform.service.version}", url = "dubbo://127.0.0.1:12316", lazy = true)

目前我的配置 生产端配置 dubbo: application: id: ${spring.application.name} name: ${spring.application.name} register-mode: instance service-discovery: migration: FORCE_APPLICATION qos-enable: false qos-accept-foreign-ip: false scan: base-packages: com.dd.modules,com.dd.framework registry:

file: ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache

address: nacos://${nacos.host}:${nacos.port}/?registry-type=service

monitor: protocol: registry protocol: name: dubbo port: 12316 server: netty4 serialization: kryo provider: retries: 0 delay: -1 timeout: 12000 consumer: timeout: 12000 check: false # 服务启动时检查被调用服务是否可用 client: netty4 retries: 0 # 服务调用重试次数

消费端配置 dubbo: application: id: ${spring.application.name} name: ${spring.application.name} service-discovery: migration: FORCE_APPLICATION qos-enable: false qos-accept-foreign-ip: false registry:

file: ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache

address: nacos://${nacos.host}:${nacos.port}

monitor: protocol: registry protocol: name: dubbo port: 12316 server: netty4 serialization: kryo consumer: timeout: 12000 check: false # 服务启动时检查被调用服务是否可用 client: netty4 retries: 0 # 服务调用重试次数

kylixs commented 3 years ago

Could you provide a simple demo project to reproduce the problem? You can upload it to this issue or give a repo url.

kylixs commented 3 years ago

目前发现DubboReference注解中不增加URL并指定IP和端口,消费端就无法访问生产端。提示生产端不存在或是列入了黑名单

如果不指定url时提示找不到provider,应该是服务注册订阅存在问题,或者是interface/group/version没有全部匹配上。

请参考Dubbo reference文档描述,如果指定了url则表示直接连接provider,如果不指定url则是从注册中心获取provider地址列表。 https://dubbo.apache.org/zh/docs/v3.0/references/configuration/references/xml/dubbo-reference/

属性 对应URL参数 类型 是否必填 缺省值 作用 描述 兼容性
url url string 可选   服务治理 点对点直连服务提供者地址,将绕过注册中心
gang0713 commented 3 years ago

在nacos控制台看到服务都注册上来了,但是不加URl就访问不了。 image

Failed to invoke the method findByNameSystemProperty in the service com.xykq.modules.system.services.ISystemPropertyService. No provider available for the service com.xykq.modules.system.services.ISystemPropertyService:1.0.0 from registry 127.0.0.1:8848 on the consumer 192.168.0.112 using the dubbo version 3.0.1. Please check if the providers have been started and registered. at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:101) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:93) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:95) ~[dubbo-3.0.1.jar:3.0.1] at org.apache.dubbo.common.bytecode.proxy2.findByNameSystemProperty(proxy2.java) ~[dubbo-3.0.1.jar:3.0.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) ~[spring-aop-5.2.15.RELEASE.jar:5.2.15.RELEASE] at com.sun.proxy.$Proxy149.findByNameSystemProperty(Unknown Source) ~[?:?]

gang0713 commented 3 years ago

看到启动的时候报了一个这样的提示,是不是因为这个影响了。这个提示的问题要怎么解决? Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.

gang0713 commented 3 years ago

@kylixs demo下载地址 https://wws.lanzoui.com/iBdRsreoj7g

2.7的版本也不行。

kylixs commented 3 years ago

@chickenlj PTAL

May be something wrong in service-discovery mode.
Using the following configuration, the consumer can successfully call the remote interface.

//provider side

dubbo:
  application:
    id: ${spring.application.name}
    name: ${spring.application.name}
    register-mode: all
#    service-discovery:
#      migration: FORCE_APPLICATION

//consumer side

dubbo:
  application:
    id: ${spring.application.name}
    name: ${spring.application.name}
#    service-discovery:
#      migration: FORCE_APPLICATION
gang0713 commented 3 years ago

@kylixs 把spring-context-support升级到1.0.11可以了,1.0.11之前的版本不行 同时升级了nacos-discovery-spring-boot-starter到0.2.10,nacos-client到2.0.2,发现现在可以了

@kylixs 后面打包发现又不可以了,还不知道啥原因。

去掉service-discovery确实可以了,但是这个是按官网说明配置的,为什么会有问题。

service-discovery:

migration: FORCE_APPLICATION

gang0713 commented 3 years ago

@kylixs 在win10下是可以了,但是部署到linux下又不行了。我centos8.3。

最新demo https://wws.lanzoui.com/iRgEPrzde0j

kylixs commented 3 years ago

@kylixs 在win10下是可以了,但是部署到linux下又不行了。我centos8.3。

在linux上具体是什么错误?

gang0713 commented 3 years ago

org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 192.168.0.20:8848 on the consumer 192.168.0.20 using the dubbo version 3.0.1. Please check if the providers have been started and registered.

pinxiong commented 3 years ago

org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 192.168.0.20:8848 on the consumer 192.168.0.20 using the dubbo version 3.0.1. Please check if the providers have been started and registered.

I have downloaded the demo you provided, and want to reproduce the issue you reported.

org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 192.168.31.167:8848 on the consumer 192.168.31.167 using the dubbo version 3.0.1. Please check if the providers have been started and registered.
    at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar:3.0.1]
    at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar:3.0.1]
    at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar:3.0.1]
    ......

I'm sure that there are something wrong with Nacos when exporting the provider, because the exception doesn't throw in NacosRegistry

private void execute(NamingServiceCallback callback) {
    try {
        callback.callback(namingService);
    } catch (NacosException e) {
        // don't throw any exception 
        if (logger.isErrorEnabled()) {
            logger.error(e.getErrMsg(), e);
        }
    }
}

By contrast, all exception will throw in ZookeeperRegistry, I'll provide a PR to fix this problem in NacosRegistry later

public void doRegister(URL url) {
    try {
        zkClient.create(toUrlPath(url), url.getParameter(DYNAMIC_KEY, true));
    } catch (Throwable e) {
        throw new RpcException("Failed to register " + url + " to zookeeper " + getUrl() + ", cause: " + e.getMessage(), e);
    }
}

Now, I need your help to provide more detailed error logs, you can get them in logs/nacos/remote.log and raysonblog_log @gang0713

gang0713 commented 3 years ago

生产端: 2021-07-31 14:27:16 INFO com.alibaba.boot.nacos.config.util.NacosConfigPropertiesUtils:47 - nacosConfigProperties : NacosConfigProperties{serverAddr='127.0.0.1:8849', contextPath='null', encode='null', endpoint='null', namespace='null', accessKey='null', secretKey='null', ramRoleName='null', autoRefresh=false, dataId='null', dataIds='null', group='DEFAULT_GROUP', type=null, maxRetry='null', configLongPollTimeout='null', configRetryTime='null', enableRemoteSyncConfig=false, extConfig=[], bootstrap=Bootstrap{enable=false, logEnable=false}} 2021-07-31 14:27:16 INFO com.alibaba.boot.nacos.config.autoconfigure.NacosConfigApplicationContextInitializer:75 - [Nacos Config Boot] : The preload configuration is not enabled 2021-07-31 14:27:16 INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:55 - Starting ShopServiceProviderApplication on xykq.com with PID 1579589 (/test/shop-service-provider-0.0.1-SNAPSHOT.jar started by root in /test) 2021-07-31 14:27:16 INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:648 - No active profile set, falling back to default profiles: default 2021-07-31 14:27:16 INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBinding2AutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 2021-07-31 14:27:16 INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 2021-07-31 14:27:16 WARN org.springframework.boot.context.properties.PropertySourcesDeducer:66 - Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 52 ms to scan 1 urls, producing 3 keys and 6 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 28 ms to scan 1 urls, producing 4 keys and 9 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 36 ms to scan 1 urls, producing 3 keys and 10 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 101 ms to scan 78 urls, producing 0 keys and 0 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 1 keys and 5 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 1 keys and 7 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 2 keys and 8 values 2021-07-31 14:27:17 INFO org.reflections.Reflections:232 - Reflections took 89 ms to scan 78 urls, producing 0 keys and 0 values 2021-07-31 14:27:26 INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:61 - Started ShopServiceProviderApplication in 10.199 seconds (JVM running for 10.687) 2021-07-31 14:27:26 INFO org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener:159 - [Dubbo] Current Spring Boot Application is await...

gang0713 commented 3 years ago

消费端: 2021-07-31 14:36:17 INFO com.alibaba.boot.nacos.config.util.NacosConfigPropertiesUtils:47 - nacosConfigProperties : NacosConfigProperties{serverAddr='127.0.0.1:8849', contextPath='null', encode='null', endpoint='null', namespace='null', accessKey='null', secretKey='null', ramRoleName='null', autoRefresh=false, dataId='null', dataIds='null', group='DEFAULT_GROUP', type=null, maxRetry='null', configLongPollTimeout='null', configRetryTime='null', enableRemoteSyncConfig=false, extConfig=[], bootstrap=Bootstrap{enable=false, logEnable=false}} 2021-07-31 14:36:17 INFO com.alibaba.boot.nacos.config.autoconfigure.NacosConfigApplicationContextInitializer:75 - [Nacos Config Boot] : The preload configuration is not enabled 2021-07-31 14:36:17 INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:55 - Starting ShopServiceConsumerApplication on xykq.com with PID 1595268 (/test/shop-service-consumer-0.0.1-SNAPSHOT.jar started by root in /test) 2021-07-31 14:36:17 INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:648 - No active profile set, falling back to default profiles: default 2021-07-31 14:36:17 INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 2021-07-31 14:36:17 INFO org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor:463 - Register dubbo reference bean: shopService = ReferenceBean:cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0() at cn.raysonblog.shopservice.api.service.RpcShopService cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.shopService 2021-07-31 14:36:17 WARN org.springframework.boot.context.properties.PropertySourcesDeducer:66 - Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment 2021-07-31 14:36:17 INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer:108 - Tomcat initialized with port(s): 9081 (http) 2021-07-31 14:36:17 INFO org.apache.coyote.http11.Http11NioProtocol:173 - Initializing ProtocolHandler ["http-nio-9081"] 2021-07-31 14:36:17 INFO org.apache.catalina.core.StandardService:173 - Starting service [Tomcat] 2021-07-31 14:36:17 INFO org.apache.catalina.core.StandardEngine:173 - Starting Servlet engine: [Apache Tomcat/9.0.46] 2021-07-31 14:36:17 INFO org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/]:173 - Initializing Spring embedded WebApplicationContext 2021-07-31 14:36:17 INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext:285 - Root WebApplicationContext: initialization completed in 800 ms 2021-07-31 14:36:18 INFO org.apache.dubbo.config.spring.reference.ReferenceCreator:95 - The configBean[type:ReferenceConfig] has been built. 2021-07-31 14:36:18 INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor:181 - Initializing ExecutorService 'applicationTaskExecutor' 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 39 ms to scan 1 urls, producing 3 keys and 6 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 27 ms to scan 1 urls, producing 4 keys and 9 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 26 ms to scan 1 urls, producing 3 keys and 10 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 124 ms to scan 89 urls, producing 0 keys and 0 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 1 keys and 5 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 1 keys and 7 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 2 keys and 8 values 2021-07-31 14:36:18 INFO org.reflections.Reflections:232 - Reflections took 100 ms to scan 89 urls, producing 0 keys and 0 values 2021-07-31 14:36:19 INFO org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler:181 - Initializing ExecutorService 'taskScheduler' 2021-07-31 14:36:19 INFO org.apache.coyote.http11.Http11NioProtocol:173 - Starting ProtocolHandler ["http-nio-9081"] 2021-07-31 14:36:19 INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer:220 - Tomcat started on port(s): 9081 (http) with context path '' 2021-07-31 14:36:23 INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:61 - Started ShopServiceConsumerApplication in 6.368 seconds (JVM running for 6.875) 2021-07-31 14:36:25 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 127.0.0.1:8849 on the consumer 192.168.0.20 using the dubbo version 3.0.1. Please check if the providers have been started and registered. at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:101) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:95) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-3.0.1.jar!/:3.0.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at com.sun.proxy.$Proxy80.sayHello(Unknown Source) ~[?:?] at cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.taskCycle(ShopServiceConsumerApplication.java:41) ~[classes!/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201] 2021-07-31 14:36:30 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 127.0.0.1:8849 on the consumer 192.168.0.20 using the dubbo version 3.0.1. Please check if the providers have been started and registered. at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:101) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:95) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-3.0.1.jar!/:3.0.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at com.sun.proxy.$Proxy80.sayHello(Unknown Source) ~[?:?] at cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.taskCycle(ShopServiceConsumerApplication.java:41) ~[classes!/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]

gang0713 commented 3 years ago

@pinxiong logs/nacos/remote.log 中未见异常,这个demo可以拿到linux下运行下看。

pinxiong commented 3 years ago

@pinxiong logs/nacos/remote.log 中未见异常,这个demo可以拿到linux下运行下看。

Source Code

I downloaded the source code and do some changes below, and then uploaded it to github repository

It's convenient for us to discussion, you can update the souce code if you want to do any changes.

Reproduce

I installed a machine and the environment as follow:

Nacos 1 4 2
Start Provider
[root@ip-192-0-4-195 spring-boot-dubbo-nacos-demo]# java -jar shop-service-provider/target/shop-service-provider-0.0.1.jar
log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.Version).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2021-08-01 02:20:17  INFO org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListener:64 - 

 :: Dubbo Spring Boot (v3.0.1) : https://github.com/apache/dubbo-spring-boot-project
 :: Dubbo (v3.0.1) : https://github.com/apache/dubbo
 :: Discuss group : dev@dubbo.apache.org

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v2.3.12.RELEASE)

2021-08-01 02:20:17  INFO com.alibaba.boot.nacos.config.util.NacosConfigPropertiesUtils:47 - nacosConfigProperties : NacosConfigProperties{serverAddr='127.0.0.1:8848', contextPath='null', encode='null', endpoint='null', namespace='null', accessKey='null', secretKey='null', ramRoleName='null', autoRefresh=false, dataId='null', dataIds='null', group='DEFAULT_GROUP', type=null, maxRetry='null', configLongPollTimeout='null', configRetryTime='null', enableRemoteSyncConfig=false, extConfig=[], bootstrap=Bootstrap{enable=false, logEnable=false}}
2021-08-01 02:20:17  INFO com.alibaba.boot.nacos.config.autoconfigure.NacosConfigApplicationContextInitializer:75 - [Nacos Config Boot] : The preload configuration is not enabled
2021-08-01 02:20:17  INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:55 - Starting ShopServiceProviderApplication on 192-0-4-195 with PID 2463 (/root/***/workspace/spring-boot-dubbo-nacos-demo/shop-service-provider/target/shop-service-provider-0.0.1.jar started by root in /root/***/workspace/spring-boot-dubbo-nacos-demo)
2021-08-01 02:20:17  INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:648 - No active profile set, falling back to default profiles: default
2021-08-01 02:20:18  INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBinding2AutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2021-08-01 02:20:18  INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2021-08-01 02:20:18  WARN org.springframework.boot.context.properties.PropertySourcesDeducer:66 - Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 113 ms to scan 1 urls, producing 3 keys and 6 values 
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 76 ms to scan 1 urls, producing 4 keys and 9 values 
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 66 ms to scan 1 urls, producing 3 keys and 10 values 
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 224 ms to scan 78 urls, producing 0 keys and 0 values 
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 43 ms to scan 1 urls, producing 1 keys and 5 values 
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 39 ms to scan 1 urls, producing 1 keys and 7 values 
2021-08-01 02:20:19  INFO org.reflections.Reflections:232 - Reflections took 36 ms to scan 1 urls, producing 2 keys and 8 values 
2021-08-01 02:20:20  INFO org.reflections.Reflections:232 - Reflections took 216 ms to scan 78 urls, producing 0 keys and 0 values 
2021-08-01 02:20:31  INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:61 - Started ShopServiceProviderApplication in 14.226 seconds (JVM running for 15.856)
2021-08-01 02:20:31  INFO org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener:159 -  [Dubbo] Current Spring Boot Application is await...
Start Consumer
[root@ip-192-0-4-195 spring-boot-dubbo-nacos-demo]# java -jar shop-service-consumer/target/shop-service-consumer-0.0.1.jar
log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.Version).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2021-08-01 02:21:31  INFO org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListener:64 - 

 :: Dubbo Spring Boot (v3.0.1) : https://github.com/apache/dubbo-spring-boot-project
 :: Dubbo (v3.0.1) : https://github.com/apache/dubbo
 :: Discuss group : dev@dubbo.apache.org

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v2.3.12.RELEASE)

2021-08-01 02:21:31  INFO com.alibaba.boot.nacos.config.util.NacosConfigPropertiesUtils:47 - nacosConfigProperties : NacosConfigProperties{serverAddr='127.0.0.1:8848', contextPath='null', encode='null', endpoint='null', namespace='null', accessKey='null', secretKey='null', ramRoleName='null', autoRefresh=false, dataId='null', dataIds='null', group='DEFAULT_GROUP', type=null, maxRetry='null', configLongPollTimeout='null', configRetryTime='null', enableRemoteSyncConfig=false, extConfig=[], bootstrap=Bootstrap{enable=false, logEnable=false}}
2021-08-01 02:21:31  INFO com.alibaba.boot.nacos.config.autoconfigure.NacosConfigApplicationContextInitializer:75 - [Nacos Config Boot] : The preload configuration is not enabled
2021-08-01 02:21:31  INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:55 - Starting ShopServiceConsumerApplication on 192-0-4-195 with PID 2989 (/root/***/workspace/spring-boot-dubbo-nacos-demo/shop-service-consumer/target/shop-service-consumer-0.0.1.jar started by root in /root/***/workspace/spring-boot-dubbo-nacos-demo)
2021-08-01 02:21:32  INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:648 - No active profile set, falling back to default profiles: default
2021-08-01 02:21:34  INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2021-08-01 02:21:34  INFO org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor:463 - Register dubbo reference bean: shopService = ReferenceBean:cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0() at cn.raysonblog.shopservice.api.service.RpcShopService cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.shopService
2021-08-01 02:21:35  WARN org.springframework.boot.context.properties.PropertySourcesDeducer:66 - Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment
2021-08-01 02:21:36  INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer:108 - Tomcat initialized with port(s): 9081 (http)
2021-08-01 02:21:36  INFO org.apache.coyote.http11.Http11NioProtocol:173 - Initializing ProtocolHandler ["http-nio-9081"]
2021-08-01 02:21:36  INFO org.apache.catalina.core.StandardService:173 - Starting service [Tomcat]
2021-08-01 02:21:36  INFO org.apache.catalina.core.StandardEngine:173 - Starting Servlet engine: [Apache Tomcat/9.0.46]
2021-08-01 02:21:36  INFO org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/]:173 - Initializing Spring embedded WebApplicationContext
2021-08-01 02:21:36  INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext:285 - Root WebApplicationContext: initialization completed in 4050 ms
2021-08-01 02:21:37  INFO org.apache.dubbo.config.spring.reference.ReferenceCreator:95 - The configBean[type:ReferenceConfig] has been built.
2021-08-01 02:21:37  INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor:181 - Initializing ExecutorService 'applicationTaskExecutor'
2021-08-01 02:21:39  INFO org.reflections.Reflections:232 - Reflections took 99 ms to scan 1 urls, producing 3 keys and 6 values 
2021-08-01 02:21:39  INFO org.reflections.Reflections:232 - Reflections took 85 ms to scan 1 urls, producing 4 keys and 9 values 
2021-08-01 02:21:39  INFO org.reflections.Reflections:232 - Reflections took 78 ms to scan 1 urls, producing 3 keys and 10 values 
2021-08-01 02:21:39  INFO org.reflections.Reflections:232 - Reflections took 472 ms to scan 89 urls, producing 0 keys and 0 values 
2021-08-01 02:21:39  INFO org.reflections.Reflections:232 - Reflections took 64 ms to scan 1 urls, producing 1 keys and 5 values 
2021-08-01 02:21:40  INFO org.reflections.Reflections:232 - Reflections took 56 ms to scan 1 urls, producing 1 keys and 7 values 
2021-08-01 02:21:40  INFO org.reflections.Reflections:232 - Reflections took 65 ms to scan 1 urls, producing 2 keys and 8 values 
2021-08-01 02:21:40  INFO org.reflections.Reflections:232 - Reflections took 425 ms to scan 89 urls, producing 0 keys and 0 values 
2021-08-01 02:21:42  INFO org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler:181 - Initializing ExecutorService 'taskScheduler'
2021-08-01 02:21:42  INFO org.apache.coyote.http11.Http11NioProtocol:173 - Starting ProtocolHandler ["http-nio-9081"]
2021-08-01 02:21:42  INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer:220 - Tomcat started on port(s): 9081 (http) with context path ''
2021-08-01 02:21:48  INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:61 - Started ShopServiceConsumerApplication in 17.698 seconds (JVM running for 20.443)
2021-08-01 02:21:50 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task
org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 127.0.0.1:8848 on the consumer 192.0.4.195 using the dubbo version 3.0.1. Please check if the providers have been started and registered.
    at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:101) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:93) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:95) ~[dubbo-3.0.1.jar!/:3.0.1]
    at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-3.0.1.jar!/:3.0.1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
    at com.sun.proxy.$Proxy80.sayHello(Unknown Source) ~[?:?]
    at cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.taskCycle(ShopServiceConsumerApplication.java:41) ~[classes!/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_301]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_301]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_301]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_301]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_301]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_301]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]

Result

I cannot get any data in Nacos portal

No data in Nacos

Also, I got some mistakes in logs/nacos/remote.log

2021-08-01 03:03:35.768 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [0e5fcd6a-47fb-40fe-a0ec-175e2df4956f] fail to connect server,after trying 543 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-01 03:03:36.330 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-01 03:03:36.330 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [facbcb0d-1b21-4fb3-8a20-19b53a22a3c4_config-0] fail to connect server,after trying 543 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-01 03:03:39.593 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-01 03:03:39.594 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [d232a7ea-c29f-4046-b5f2-3f0c5b11df3d] fail to connect server,after trying 543 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-01 03:03:39.782 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-01 03:03:39.782 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [babf4f72-b39d-46d0-b469-14fd173f828e] fail to connect server,after trying 543 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-01 03:03:40.238 ERROR [com.alibaba.nacos.client.Worker:remote.client] Send request fail, request=ConfigBatchListenRequest{headers={charset=UTF-8, Client-AppName=unknown, Client-RequestToken=583727c5868e57894225406f5245d218, Client-RequestTS=1627787020138, exConfigInfo=true, Timestamp=1627787020138}, requestId='null'}, retryTimes=0,errorMessage=Client not connected,current status:STARTING
2021-08-01 03:03:40.243 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-01 03:03:40.244 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [9a83d9f9-783b-4846-a532-e4c1a91095ac_config-0] fail to connect server,after trying 543 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-01 03:03:40.338 ERROR [com.alibaba.nacos.client.Worker:remote.client] Send request fail, request=ConfigBatchListenRequest{headers={charset=UTF-8, Client-AppName=unknown, Client-RequestToken=583727c5868e57894225406f5245d218, Client-RequestTS=1627787020138, exConfigInfo=true, Timestamp=1627787020138}, requestId='null'}, retryTimes=1,errorMessage=Client not connected,current status:STARTING
2021-08-01 03:03:40.439 ERROR [com.alibaba.nacos.client.Worker:remote.client] Send request fail, request=ConfigBatchListenRequest{headers={charset=UTF-8, Client-AppName=unknown, Client-RequestToken=583727c5868e57894225406f5245d218, Client-RequestTS=1627787020138, exConfigInfo=true, Timestamp=1627787020138}, requestId='null'}, retryTimes=2,errorMessage=Client not connected,current status:STARTING
2021-08-01 03:03:40.770 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-01 03:03:40.770 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [0e5fcd6a-47fb-40fe-a0ec-175e2df4956f] fail to connect server,after trying 544 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
gang0713 commented 3 years ago

@pinxiong 不行,windos10下,nacos控制台有数据,linux下没有。CentOS Linux release 8.3.2011

下图是win10下的nacos控制台有数据 image

pinxiong commented 3 years ago

@pinxiong 不行,windos10下,nacos控制台有数据,linux下没有。CentOS Linux release 8.3.2011

下图是win10下的nacos控制台有数据 image

@gang0713 Your reply makes me confused, I think we're not discussing about the same thing.

Now, Let's make sure of a few things below

I hope we can discuss more efficiently, because it takes a lot of energy to build different environments.

pinxiong commented 3 years ago

@gang0713 I upgraded Nacos and the problem seems to have disappeared.

What I did

Nacos 2 0 2 Nacos Data

Conclusion

Can you check if the problem can be disappeared, after upgraded Nacos from 1.4.2 to 2.0.2 ?

gang0713 commented 3 years ago

我的部署环境是CentOS 8.3.2011,jdk1.8,我昨天是用您 的代码测试的,还是和之前一样。 消费端使用正常会打下面的日志: image

5秒调用一次。

pinxiong commented 3 years ago

我的部署环境是CentOS 8.3.2011,jdk1.8,我昨天是用您 的代码测试的,还是和之前一样。 消费端使用正常会打下面的日志: image

5秒调用一次。

OK, can you tell me what the problem is now?

gang0713 commented 3 years ago

我用您的代码,在centos8.3下支行,还是报错 服务端: log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.Version). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 2021-08-02 10:47:01 INFO org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListener:64 -

:: Dubbo Spring Boot (v3.0.1) : https://github.com/apache/dubbo-spring-boot-project :: Dubbo (v3.0.1) : https://github.com/apache/dubbo :: Discuss group : dev@dubbo.apache.org

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.3.12.RELEASE)

2021-08-02 10:47:01 INFO com.alibaba.boot.nacos.config.util.NacosConfigPropertiesUtils:47 - nacosConfigProperties : NacosConfigProperties{serverAddr='192.168.0.20:8849', contextPath='null', encode='null', endpoint='null', namespace='null', accessKey='null', secretKey='null', ramRoleName='null', autoRefresh=false, dataId='null', dataIds='null', group='DEFAULT_GROUP', type=null, maxRetry='null', configLongPollTimeout='null', configRetryTime='null', enableRemoteSyncConfig=false, extConfig=[], bootstrap=Bootstrap{enable=false, logEnable=false}} 2021-08-02 10:47:01 INFO com.alibaba.boot.nacos.config.autoconfigure.NacosConfigApplicationContextInitializer:75 - [Nacos Config Boot] : The preload configuration is not enabled 2021-08-02 10:47:01 INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:55 - Starting ShopServiceProviderApplication on xykq.com with PID 299497 (/test/shop-service-provider-0.0.1.jar started by root in /test) 2021-08-02 10:47:01 INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:648 - No active profile set, falling back to default profiles: default 2021-08-02 10:47:01 INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBinding2AutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 2021-08-02 10:47:01 INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 2021-08-02 10:47:02 WARN org.springframework.boot.context.properties.PropertySourcesDeducer:66 - Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 53 ms to scan 1 urls, producing 3 keys and 6 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 31 ms to scan 1 urls, producing 4 keys and 9 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 37 ms to scan 1 urls, producing 3 keys and 10 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 102 ms to scan 78 urls, producing 0 keys and 0 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 20 ms to scan 1 urls, producing 1 keys and 5 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 20 ms to scan 1 urls, producing 1 keys and 7 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 20 ms to scan 1 urls, producing 2 keys and 8 values 2021-08-02 10:47:02 INFO org.reflections.Reflections:232 - Reflections took 107 ms to scan 78 urls, producing 0 keys and 0 values 2021-08-02 10:47:11 INFO cn.raysonblog.shopserviceprovider.ShopServiceProviderApplication:61 - Started ShopServiceProviderApplication in 10.228 seconds (JVM running for 10.708) 2021-08-02 10:47:11 INFO org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener:159 - [Dubbo] Current Spring Boot Application is await...

消费端: :: Dubbo Spring Boot (v3.0.1) : https://github.com/apache/dubbo-spring-boot-project :: Dubbo (v3.0.1) : https://github.com/apache/dubbo :: Discuss group : dev@dubbo.apache.org

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.3.12.RELEASE)

2021-08-02 10:47:15 INFO com.alibaba.boot.nacos.config.util.NacosConfigPropertiesUtils:47 - nacosConfigProperties : NacosConfigProperties{serverAddr='192.168.0.20:8849', contextPath='null', encode='null', endpoint='null', namespace='null', accessKey='null', secretKey='null', ramRoleName='null', autoRefresh=false, dataId='null', dataIds='null', group='DEFAULT_GROUP', type=null, maxRetry='null', configLongPollTimeout='null', configRetryTime='null', enableRemoteSyncConfig=false, extConfig=[], bootstrap=Bootstrap{enable=false, logEnable=false}} 2021-08-02 10:47:15 INFO com.alibaba.boot.nacos.config.autoconfigure.NacosConfigApplicationContextInitializer:75 - [Nacos Config Boot] : The preload configuration is not enabled 2021-08-02 10:47:15 INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:55 - Starting ShopServiceConsumerApplication on xykq.com with PID 300496 (/test/shop-service-consumer-0.0.1.jar started by root in /test) 2021-08-02 10:47:15 INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:648 - No active profile set, falling back to default profiles: default 2021-08-02 10:47:15 INFO org.springframework.context.annotation.ConfigurationClassPostProcessor:413 - Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 2021-08-02 10:47:15 INFO org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor:463 - Register dubbo reference bean: shopService = ReferenceBean:cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0() at cn.raysonblog.shopservice.api.service.RpcShopService cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.shopService 2021-08-02 10:47:15 WARN org.springframework.boot.context.properties.PropertySourcesDeducer:66 - Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment 2021-08-02 10:47:16 INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer:108 - Tomcat initialized with port(s): 9081 (http) 2021-08-02 10:47:16 INFO org.apache.coyote.http11.Http11NioProtocol:173 - Initializing ProtocolHandler ["http-nio-9081"] 2021-08-02 10:47:16 INFO org.apache.catalina.core.StandardService:173 - Starting service [Tomcat] 2021-08-02 10:47:16 INFO org.apache.catalina.core.StandardEngine:173 - Starting Servlet engine: [Apache Tomcat/9.0.46] 2021-08-02 10:47:16 INFO org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/]:173 - Initializing Spring embedded WebApplicationContext 2021-08-02 10:47:16 INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext:285 - Root WebApplicationContext: initialization completed in 882 ms 2021-08-02 10:47:16 INFO org.apache.dubbo.config.spring.reference.ReferenceCreator:95 - The configBean[type:ReferenceConfig] has been built. 2021-08-02 10:47:16 INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor:181 - Initializing ExecutorService 'applicationTaskExecutor' 2021-08-02 10:47:16 INFO org.reflections.Reflections:232 - Reflections took 47 ms to scan 1 urls, producing 3 keys and 6 values 2021-08-02 10:47:16 INFO org.reflections.Reflections:232 - Reflections took 35 ms to scan 1 urls, producing 4 keys and 9 values 2021-08-02 10:47:16 INFO org.reflections.Reflections:232 - Reflections took 28 ms to scan 1 urls, producing 3 keys and 10 values 2021-08-02 10:47:16 INFO org.reflections.Reflections:232 - Reflections took 168 ms to scan 89 urls, producing 0 keys and 0 values 2021-08-02 10:47:16 INFO org.reflections.Reflections:232 - Reflections took 22 ms to scan 1 urls, producing 1 keys and 5 values 2021-08-02 10:47:17 INFO org.reflections.Reflections:232 - Reflections took 19 ms to scan 1 urls, producing 1 keys and 7 values 2021-08-02 10:47:17 INFO org.reflections.Reflections:232 - Reflections took 20 ms to scan 1 urls, producing 2 keys and 8 values 2021-08-02 10:47:17 INFO org.reflections.Reflections:232 - Reflections took 104 ms to scan 89 urls, producing 0 keys and 0 values 2021-08-02 10:47:17 INFO org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler:181 - Initializing ExecutorService 'taskScheduler' 2021-08-02 10:47:17 INFO org.apache.coyote.http11.Http11NioProtocol:173 - Starting ProtocolHandler ["http-nio-9081"] 2021-08-02 10:47:17 INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer:220 - Tomcat started on port(s): 9081 (http) with context path '' 2021-08-02 10:47:21 INFO cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication:61 - Started ShopServiceConsumerApplication in 6.669 seconds (JVM running for 7.215) 2021-08-02 10:47:25 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 192.168.0.20:8849 on the consumer 192.168.0.20 using the dubbo version 3.0.1. Please check if the providers have been started and registered. at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:101) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:95) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-3.0.1.jar!/:3.0.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at com.sun.proxy.$Proxy80.sayHello(Unknown Source) ~[?:?] at cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.taskCycle(ShopServiceConsumerApplication.java:41) ~[classes!/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201] 2021-08-02 10:47:30 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.raysonblog.shopservice.api.service.RpcShopService. No provider available for the service cn.raysonblog.shopservice.api.service.RpcShopService:1.0.0 from registry 192.168.0.20:8849 on the consumer 192.168.0.20 using the dubbo version 3.0.1. Please check if the providers have been started and registered. at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:288) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:59) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:101) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:82) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:95) ~[dubbo-3.0.1.jar!/:3.0.1] at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-3.0.1.jar!/:3.0.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) ~[spring-aop-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at com.sun.proxy.$Proxy80.sayHello(Unknown Source) ~[?:?] at cn.raysonblog.shopserviceconsumer.ShopServiceConsumerApplication.taskCycle(ShopServiceConsumerApplication.java:41) ~[classes!/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]

pinxiong commented 3 years ago

@gang0713 Have you upgraded the Nacos to 2.0.2 yet?

gang0713 commented 3 years ago

@pinxiong 是的,我win10下也是用的Nacos 2.0.2 和1.4.2都可以。就是部署到centos8.3下就不行。 我这个Nacos是部署在docker上的。

image

gang0713 commented 3 years ago

@pinxiong 我知道原因了,在centos8下,使用docker部署的Nacos不行。不用docker部署的没问题,控制台也能看到注册信息。 下面是同一台服务器上,不使用docker部署的Nacos,能正常注册上来,并能正常访问。 image

pinxiong commented 3 years ago

Great! Should all problems related Dubbo have been solved? @gang0713

gang0713 commented 3 years ago

@pinxiong 是的,因为我现在nacos都是部署在docker上的,希望这个问题尽快解决掉。

pinxiong commented 3 years ago

@pinxiong 是的,因为我现在nacos都是部署在docker上的,希望这个问题尽快解决掉。

@gang0713 I think you'd better ask Nacos to take a look at this issue.

We'll close this issue, it can be reopened if necessary.

&READY-TO-CLOSE&

gang0713 commented 3 years ago

@pinxiong 是的,因为我现在nacos都是部署在docker上的,希望这个问题尽快解决掉。

@gang0713 I think you'd better ask Nacos to take a look at this issue.

We'll close this issue, it can be reopened if necessary.

&READY-TO-CLOSE&

好的,辛苦了

pinxiong commented 3 years ago

Environment

I was trying to use docker run Nacos and then run shop-service-provider and shop-service-consumer to reproduce this issu again. I found some errors in logs/nacos/remote.log

2021-08-04 11:39:26.523 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]RpcClient init, ServerListFactory =com.alibaba.nacos.client.naming.core.ServerListManager
2021-08-04 11:39:26.530 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] Try to connect to server on start up, server: {serverIp='127.0.0.1', server main port=8848}
2021-08-04 11:39:27.569 ERROR [main :grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.573 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] Try to connect to server on start up, server: {serverIp='127.0.0.1', server main port=8848}
2021-08-04 11:39:27.588 ERROR [main :grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.589 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] Try to connect to server on start up, server: {serverIp='127.0.0.1', server main port=8848}
2021-08-04 11:39:27.597 ERROR [main :grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.598 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
2021-08-04 11:39:27.599 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$4
2021-08-04 11:39:27.599 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Register server push request handler:com.alibaba.nacos.client.naming.remote.gprc.NamingPushRequestHandler
2021-08-04 11:39:27.600 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Registry connection listener to current client:com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcConnectionEventListener
2021-08-04 11:39:27.600 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] try to re connect to a new server ,server is  not appointed,will choose a random server.
2021-08-04 11:39:27.632 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.756 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.757 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] fail to connect server,after trying 1 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-04 11:39:27.978 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception

That make me sure there is something wrong with Nacos. Also, I find the related issue in blog .

@gang0713 Now, I think we need to follow the issue#6521 and push them to help us fix this problem.

gang0713 commented 3 years ago

Environment

I was trying to use docker run Nacos and then run shop-service-provider and shop-service-consumer to reproduce this issu again. I found some errors in logs/nacos/remote.log

2021-08-04 11:39:26.523 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]RpcClient init, ServerListFactory =com.alibaba.nacos.client.naming.core.ServerListManager
2021-08-04 11:39:26.530 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] Try to connect to server on start up, server: {serverIp='127.0.0.1', server main port=8848}
2021-08-04 11:39:27.569 ERROR [main :grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.573 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] Try to connect to server on start up, server: {serverIp='127.0.0.1', server main port=8848}
2021-08-04 11:39:27.588 ERROR [main :grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.589 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] Try to connect to server on start up, server: {serverIp='127.0.0.1', server main port=8848}
2021-08-04 11:39:27.597 ERROR [main :grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.598 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
2021-08-04 11:39:27.599 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$4
2021-08-04 11:39:27.599 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Register server push request handler:com.alibaba.nacos.client.naming.remote.gprc.NamingPushRequestHandler
2021-08-04 11:39:27.600 INFO [main :remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423]Registry connection listener to current client:com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcConnectionEventListener
2021-08-04 11:39:27.600 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] try to re connect to a new server ,server is  not appointed,will choose a random server.
2021-08-04 11:39:27.632 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.756 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
2021-08-04 11:39:27.757 INFO [com.alibaba.nacos.client.remote.worker:remote.client] [1fa7febd-66d0-4d0a-89f7-558273620423] fail to connect server,after trying 1 times, last try server is {serverIp='127.0.0.1', server main port=8848},error=unknown
2021-08-04 11:39:27.978 ERROR [com.alibaba.nacos.client.remote.worker:grpc.GrpcClient] Server check fail, please check server 127.0.0.1 ,port 9848 is available , error =java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception

That make me sure there is something wrong with Nacos. Also, I find the related issue in blog .

@gang0713 Now, I think we need to follow the issue#6521 and push them to help us fix this problem.

@pinxiong yes.

gang0713 commented 3 years ago

@pinxiong 使用https://github.com/nacos-group/nacos-docker 中的例子可以了。要多开一个端口。 Tips: You can change the version of the Nacos image in the compose file from the following configuration. example/.env NACOS_VERSION=2.0.2 Run the following command:

Clone project

git clone --depth 1 https://github.com/nacos-group/nacos-docker.git cd nacos-docker Standalone Derby

docker-compose -f example/standalone-derby.yaml up