代码编织梦想

背景

服务注册nacos,版本2.0.4,出现如下错误

解析

看报错可以看出是服务器被拒绝,网上说版本问题可能导致这个问题,不过我的这个不是这种原因引起的;

nacos从2+版本开始,增加了9848,9849端口来进行GRPC通信,所以在使用docker-compose搭建nacos的同时,要额外转发另外两个端口即可:

    ports:  # 映射端口
      - "8848:8848"
      - "9848:9848"
      - "9849:9849"

报错日志

21:36:55.037 [main] ERROR c.a.c.n.d.NacosWatch - [stop,178] - namingService unsubscribe failed, properties:NacosDiscoveryProperties{serverAddr='xxxxxx:8848', username='', password='', endpoint='', namespace='', watchDelay=30000, logName='', service='ruoyi-gateway', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='192.168.1.3', networkInterface='', port=8080, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, instanceEnabled=true, ephemeral=true, failureToleranceEnabled=false}, 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:290)
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.doUnsubscribe(NamingGrpcClientProxy.java:260)
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.unsubscribe(NamingGrpcClientProxy.java:241)
	at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.unsubscribe(NamingClientProxyDelegate.java:157)
	at com.alibaba.nacos.client.naming.NacosNamingService.unsubscribe(NacosNamingService.java:417)
	at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:174)
	at com.alibaba.cloud.nacos.discovery.NacosWatch.destroy(NacosWatch.java:204)
	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:213)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156)
	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:596)
	at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
	at com.ruoyi.gateway.RuoYiGatewayApplication.main(RuoYiGatewayApplication.java:17)
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:650)
	at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:630)
	at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:280)
	... 21 common frames omitted
21:36:55.295 [main] INFO  c.a.n.c.r.client - [shutdown,454] - Shutdown rpc client, set status to shutdown
21:36:55.295 [main] INFO  c.a.n.c.r.client - [shutdown,456] - Shutdown client event executor java.util.concurrent.ScheduledThreadPoolExecutor@23e9dd78[Running, pool size = 2, active threads = 2, queued tasks = 0, completed tasks = 0]
21:36:55.295 [main] INFO  c.a.n.c.r.c.g.GrpcClient - [shutdown,85] - Shutdown grpc executor java.util.concurrent.ThreadPoolExecutor@470c4229[Running, pool size = 8, active threads = 0, queued tasks = 0, completed tasks = 8]
21:36:55.295 [com.alibaba.nacos.client.remote.worker] ERROR c.a.n.c.r.c.g.GrpcClient - [printIfErrorEnabled,99] - Server check fail, please check server 47.94.7.122 ,port 9848 is available , error ={}
java.lang.InterruptedException: null
	at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:438)
	at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:148)
	at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:264)
	at com.alibaba.nacos.common.remote.client.RpcClient.reconnect(RpcClient.java:522)
	at com.alibaba.nacos.common.remote.client.RpcClient.lambda$start$2(RpcClient.java:370)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/xianyun1992/article/details/129628894

nacos异常之com.alibaba.nacos.api.exception.NacosException: failed to req API:/api//nacos/v1/ns/instance-爱代码爱编程

1.问题描述 com.alibaba.nacos.api.exception.NacosException: failed to req API:/api//nacos/v1/ns/instance after all servers([localhost:8848]) tried: java.net.ConnectException: Connec

无法连接到Nacos Caused by: com.alibaba.nacos.api.exception.NacosException: failed to req API-爱代码爱编程

1.Nacos未启动 nacos\nacos\bin下的cmd文件双击启动  2.Nacos与其他依赖之间的版本问题 <dependency> <groupId>org.springframework.boot</groupId>

com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance/list after a-爱代码爱编程

错误信息 com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance/list after all servers([localhost:8848]) tried: java.net.ConnectException: Connection

NACOS 异常com.alibaba.nacos.api.exception.NacosException: failed to req API:/api//nacos/v1/ns/instance-爱代码爱编程

NACOS 异常com.alibaba.nacos.api.exception.NacosException: failed to req API:/api//nacos/v1/ns/instance 服务注册到nacos报错:com.alibaba.nacos.api.exception.NacosException: failed to req AP

com.alibaba.nacos.api.exception.NacosException: Request nacos server failed:-爱代码爱编程

com.alibaba.nacos.api.exception.NacosException: Request nacos server failed: at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClien

【BUG记录】com.alibaba.nacos.api.exception.NacosException: Request nacos server failed-爱代码爱编程

BUG背景 使用docker搭建nacos服务后,准备用java客户端连接nacos server的时候出现了如下问题,连接不上。(可能和大家的导致的问题不一样) BUG日志 如下的报错可以看见gprc的字眼,咦,不是grpc吗,先不管那么多 com.alibaba.nacos.api.exception.NacosException: Reque

nacos集群nginx做反向代理报错com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns-爱代码爱编程

做了两个微服务 然后userapplication能成功注册   而orderapplication却报错 com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance after all servers([localhost:

【bug记录】com.alibaba.nacos.api.exception.nacosexception request nacos server failed_egegerhn的博客-爱代码爱编程

BUG背景 使用docker搭建nacos服务后,准备用java客户端连接nacos server的时候出现了如下问题,连接不上。(可能和大家的导致的问题不一样) BUG日志 如下的报错可以看见gprc的字眼,咦,不是grpc吗,先不管那么多 com.alibaba.nacos.api.exception.NacosException: Reque

【bug记录】com.alibaba.nacos.api.exception.nacosexception: request nacos server failed:_重量级退堂鼓演奏家的博客-爱代码爱编程

【BUG日志】 com.alibaba.nacos.api.exception.NacosException: Request nacos server failed: at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(Naming

com.alibaba.nacos.api.exception.nacosexception: request nacos server failed_常识的blog的博客-爱代码爱编程

这几天在搭建spring cloud alibaba 遇到的问题,作为笔记记录下来,方便自己。 问题描述 异常信息: 2022-10-19 15:29:27.936 ERROR 14308 --- [

redisson项目地址-爱代码爱编程

github 项目 https://github.com/redisson/redisson 整合 spring boot 使用 https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter#spring-boot-starter 对应配置类以

【spring6】事务-爱代码爱编程

7、事务 7.1、JdbcTemplate 7.1.1、简介 Spring 框架对 JDBC 进行封装,使用 JdbcTemplate 方便实现对数据库操作 7.1.2、准备工作 ①搭建子模块 搭建子模块:s