duboo ERROR 10844 --- [ main] c.a.c.n.registry.NacosServiceRegistry : nacos registry, d

本文讲述了2021年4月29日遇到的Nacos服务注册问题,涉及NacosServiceRegistry的异常,具体表现为服务实例格式不正确。通过排查和修改配置,最终实现Dubbo服务正常注册。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

2021-04-29 10:39:47.148 ERROR 10844 — [ main] c.a.c.n.registry.NacosServiceRegistry : nacos registry, dubbo-service1 register failed…NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr=‘localhost:8848’, endpoint=’’, namespace=‘8dd0360a-b54a-422c-bacd-212910c9269a’, watchDelay=30000, logName=’’, service=‘dubbo-service1’, weight=1.0, clusterName=‘DEFAULT’, namingLoadCacheAtStart=‘false’, metadata={dubbo.metadata-service.urls=[ “dubbo://192.168.1.2:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=dubbo-service1&bind.ip=192.168.1.2&bind.port=20881&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=dubbo-service1&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=10844&qos.enable=false&register=true&release=2.7.3&revision=2.1.0.RELEASE&side=provider&timestamp=1619663986662&version=1.0.0” ], preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip=‘192.168.1.2’, networkInterface=’’, port=-1, secure=false, accessKey=’’, secretKey=’’}},

java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance after all servers([localhost:8848]) tried: failed to req API:localhost:8848/nacos/v1/ns/instance. code:400 msg: instance format invalid:192.168.1.2:unknown:DEFAULT_1.0_true_false_DEFAULT
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:464) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.nacos.client.naming.net.NamingProxy.registerService(NamingProxy.java:188) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:205) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:184) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:61) ~[spring-cloud-alibaba-nacos-discovery-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at com.alibaba.cloud.nacos.registry.NacosServiceRegistryFastClassBySpringCGLIBFastClassBySpringCGLIBFastClassBySpringCGLIBca3a8dbd.invoke() [spring-cloud-alibaba-nacos-discovery-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.aop.framework.CglibAopProxyCglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)[spring−aop−5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.CglibAopProxyCglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.aop.framework.CglibAopProxyCglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)[springaop5.1.5.RELEASE.jar:5.1.5.RELEASE]atorg.springframework.aop.framework.CglibAopProxyDynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) [spring-aop-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at com.alibaba.cloud.nacos.registry.NacosServiceRegistryEnhancerBySpringCGLIBEnhancerBySpringCGLIBEnhancerBySpringCGLIB7824d666.register() [spring-cloud-alibaba-nacos-discovery-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at com.alibaba.cloud.dubbo.autoconfigure.DubboServiceRegistrationNonWebApplicationAutoConfiguration.register(DubboServiceRegistrationNonWebApplicationAutoConfiguration.java:92) [spring-cloud-alibaba-dubbo-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at com.alibaba.cloud.dubbo.autoconfigure.DubboServiceRegistrationNonWebApplicationAutoConfiguration.onApplicationStarted(DubboServiceRegistrationNonWebApplicationAutoConfiguration.java:85) [spring-cloud-alibaba-dubbo-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:259) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:179) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:142) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:99) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:72) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at com.hanbojun.microservice.service1.Service1Bootstrap.main(Service1Bootstrap.java:9) [classes/:na]

注册信息失败
2021-04-29 10:39:47.148 ERROR 10844 — [ main] c.a.c.n.registry.NacosServiceRegistry : nacos registry, dubbo-service1 register

server:
  port: 9952
spring:
  application:
    name: dubbo-service1
  main:
    allow-bean-definition-overriding: true #sprinmg boot 2.1需要设定
  cloud:
    nacos:
      discovery:  #Nacos 服务发现与注册配置,其中子属性 server-addr 指定 Nacos 服务器 主机和端口
        server-addr: localhost:8848
        namespace: 8dd0360a-b54a-422c-bacd-212910c9269a #指定开发环境的id
        cluster-name: DEFAULT #默认集群
dubbo:
  scan:
    #dubbo扫描基准包
    base-packages: com.dubbo.microservice.service1.service

  protocol:
    #dubbo协议
    name: dubbo
    #dubbo协议端口
    port: 20881
  registry:
    address: nacos://localhost:8848
  application:
    qos-enable: false #duboo运维服务是否开启
  consumer:
    check: false #启动时是否检查依赖的服务

经过排查后
在这里插入图片描述
修改后启动正常

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值