nacos错误:com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance

2021-12-18 11:39:44.536 ERROR 26756 --- [           main] c.a.c.n.registry.NacosServiceRegistry    : nacos registry, cs-qq-guild register failed...NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='xxxx:8848', endpoint='', namespace='xxxx', watchDelay=30000, logName='', service='xxx', weight=1.0, clusterName='DEFAULT', group='xxx', namingLoadCacheAtStart='false', metadata={appname=xxx, preserved.register.source=SPRING_CLOUD, version=0.0.1}, registerEnabled=true, ip='xxx', networkInterface='', port=5203, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, failFast=true}},

com.alibaba.nacos.api.exception.NacosException: Request nacos server failed: 
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:279) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.doRegisterService(NamingGrpcClientProxy.java:129) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.registerService(NamingGrpcClientProxy.java:115) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.registerService(NamingClientProxyDelegate.java:95) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:145) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:74) ~[spring-cloud-starter-alibaba-nacos-discovery-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:239) [spring-cloud-commons-2.2.9.RELEASE.jar:2.2.9.RELEASE]
	at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78) [spring-cloud-starter-alibaba-nacos-discovery-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:138) [spring-cloud-commons-2.2.9.RELEASE.jar:2.2.9.RELEASE]
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:101) [spring-cloud-commons-2.2.9.RELEASE.jar:2.2.9.RELEASE]
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:88) [spring-cloud-commons-2.2.9.RELEASE.jar:2.2.9.RELEASE]
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47) [spring-cloud-commons-2.2.9.RELEASE.jar:2.2.9.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:165) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.13.RELEASE.jar:2.2.13.RELEASE]
	at com.yzycoc.discord.QqGuildApplication.main(QqGuildApplication.java:33) [classes/:na]
Caused by: com.alibaba.nacos.api.exception.NacosException: Client not connected,current status:STARTING
	at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:655) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:635) ~[nacos-client-2.0.3.jar:na]
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:269) ~[nacos-client-2.0.3.jar:na]
	... 25 common frames omitted
nacos可以正常启动,但是微服务注册不进去,导致编译报错
前一天可以正常使用,今天启动出现了上面的错误

我这边是因为application.yml中配置nacos的地址是 localhost:8848
而我们启动的nacos的地址是 198.168.52.12 (为什么突然变成这个地址?搞不懂)

解决:

修改 nacos/conf/application.properties 文件

在这里插入图片描述

2.要是还不行,可以尝试将nacos的缓存删掉

本地缓存目录默认路径:${user.home}/nacos/naming/public

3.实在没办法,建议卸载重装。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
引用和中提到了Caused by: com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance。这个错误表示在请求API时出现了问题。具体而言,这个错误可能是由于连接超时或授权失败导致的。在引用中,错误信息中提到了java.net.SocketTimeoutException: connect timed out,这意味着连接超时。而在引用中,错误信息中提到了authorization failed,这意味着授权失败。 该错误的原因可以是多种可能性,例如网络连接问题、授权凭证错误或接口调用限制。为了解决该问题,可以尝试以下几个步骤: 1. 检查网络连接:确保网络连接正常,检查服务器是否可访问,尝试使用其他网络环境或设备进行访问。 2. 检查授权凭证:确认提供的账号密码是否正确,确保具有足够的权限来访问该API。如果是使用了新的用户账号密码,请确保在Nacos中正确配置了该账号的权限。 3. 检查接口调用限制:如果是因为接口调用次数限制导致的错误,可以查看Nacos的接口调用限制设置,并根据需要进行调整。 4. 更新Nacos:如果以上步骤都没有解决问题,可以考虑升级或更新Nacos版本,以确保使用的是最新的稳定版本。 需要根据实际情况进行具体的排查和解决措施。如果问题仍然存在,建议详细查看错误日志和相关文档,或向Nacos的开发者社区或官方支持寻求帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [nacos-dubbo:dubbo微服务使用nacos注册中心](https://download.csdn.net/download/weixin_42117037/16111159)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Caused by: com.alibaba.nacos.api.exception.NacosException: endpoint is blank](https://blog.csdn.net/weixin_44441009/article/details/124001793)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [【异常】Nacos异常Caused by: com.alibaba.nacos.api.exception.NacosException: authorization failed!](https://blog.csdn.net/wstever/article/details/130393799)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值