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 2021/11/18 05:55:52 UTC

[GitHub] [dubbo] zuonidelaowang opened a new issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

zuonidelaowang opened a new issue #9293:
URL: https://github.com/apache/dubbo/issues/9293


   dubbo 3.0.4
   nacos 2.0+
   
   ```
   dubbo:
     application:
       name: ${server.name}
       metadata-type: local
     protocol:
       port: -1
       name: dubbo
     registry:
       address: nacos://${nacos.server}?registry-type=service
       parameters:
         namespace: ${nacos.namespace}
       use-as-metadata-center: false
       use-as-config-center: false
   ```
   
   provider配置了以下参数,不想在nacos配置中心显示dubbo的配置文件
   ```
   metadata-type: local
   use-as-metadata-center: false    
   use-as-config-center: false
   ```
   
   comsumer启动的时候报以下错误
   ```
   java.lang.IllegalStateException: the metadata report was not initialized.
   	at org.apache.dubbo.metadata.report.MetadataReportInstance.checkInit(MetadataReportInstance.java:87) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.metadata.report.MetadataReportInstance.getMetadataReport(MetadataReportInstance.java:76) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.metadata.MetadataServiceNameMapping.getAndListen(MetadataServiceNameMapping.java:107) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.metadata.AbstractServiceNameMapping.getAndListenServices(AbstractServiceNameMapping.java:101) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:213) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:201) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:109) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:160) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.subscribe(ServiceDiscoveryRegistryDirectory.java:106) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:560) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.integration.RegistryProtocol.getServiceDiscoveryInvoker(RegistryProtocol.java:536) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshServiceDiscoveryInvoker(MigrationInvoker.java:424) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToForceApplicationInvoker(MigrationInvoker.java:201) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:76) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:42) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:241) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:529) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:498) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:483) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:83) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:74) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.ReferenceConfig.createInvokerForRemote(ReferenceConfig.java:474) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:379) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:266) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:203) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:117) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:326) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.deploy.DefaultModuleDeployer$$Lambda$1002/0x000000006fc20a20.accept(Unknown Source) ~[na:na]
   	at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4772) ~[na:na]
   	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:306) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:146) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:108) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:98) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:44) ~[dubbo-3.0.4.jar:3.0.4]
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:554) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:40002) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:41008) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
   	at com.test.demo.DemoApplication.main(DemoApplication.java:21) ~[classes/:an]
   ```


-- 
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] Yanniiii removed a comment on issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

Posted by GitBox <gi...@apache.org>.
Yanniiii removed a comment on issue #9293:
URL: https://github.com/apache/dubbo/issues/9293#issuecomment-1000096345


   @zuonidelaowang 
   服务自省架构中consumer需要知道接口到应用名的映射,这个映射信息默认由provider在发布服务时添加到配置中心,如果用nacos的话,可以看到一条类型为mapping的配置项。
   如果你觉得配置中心压力太大了,可以在provider端设置` use-as-metadata-center: false`,并在consumer的接口处声明该接口对应的应用名,由consumer自己维护这个映射关系,如
   `    @DubboReference(providedBy = "spring-boot-demo-provider",version = "1.0.0",group = "group1") `
   希望可以解决你的问题。
   


-- 
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] Yanniiii commented on issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

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


   @zuonidelaowang 
   服务自省架构中consumer需要知道接口到应用名的映射,这个映射信息默认由provider在发布服务时添加到配置中心,如果用nacos的话,可以看到一条类型为mapping的配置项。
   如果你觉得配置中心压力太大了,可以在provider端设置` use-as-metadata-center: false`,并在consumer的接口处声明该接口对应的应用名,由consumer自己维护这个映射关系,如
   `    @DubboReference(providedBy = "spring-boot-demo-provider",version = "1.0.0",group = "group1") `
   希望可以解决你的问题。
   


-- 
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] losymear commented on issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

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


   之前碰到同样的问题,无法解决,只能不使用`metadata-type: local`的方式,用nacos当作元数据中心。  目前nacos负载过大,经常出现超时。
   


-- 
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] zuonidelaowang commented on issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

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


   > @zuonidelaowang 只配置这个use-as-metadata-center: false 测试没发现有元数据上报了
   
   但是业务调用出现问题了,comsumer 调用 provider 有问题, 你用应用级别的注册方式,不要用接口的方式注册
   ```
   dubbo:
     registry:
       address: nacos://${nacos.server}?registry-type=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

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] leyou240 commented on issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

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


   @zuonidelaowang 
   只配置这个use-as-metadata-center: false 测试没发现有元数据上报了


-- 
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] zuonidelaowang commented on issue #9293: 配置禁用元数据中心后,comsumer启动报错,我该怎么配置?

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


   > @zuonidelaowang
   > 服务自省架构中consumer需要知道接口到应用名的映射,这个映射信息默认由provider在发布服务时添加到配置中心,如果用nacos的话,可以看到一条类型为mapping的配置项。
   > 如果你觉得配置中心压力太大了,可以在provider端设置` use-as-metadata-center: false`,并在consumer的接口处声明该接口对应的应用名,由consumer自己维护这个映射关系,如
   > ` @DubboReference(providedBy = "spring-boot-demo-provider",version = "1.0.0",group = "group1")`
   > 希望可以解决你的问题。
   
   感谢,我试试。


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