首页 > 其他分享 >nacos-client中grpc连接问题,不断提示报错

nacos-client中grpc连接问题,不断提示报错

时间:2022-08-15 09:11:22浏览次数:55  
标签:grpc true nacos alibaba client 报错 com cloud

2022-08-15 09:03:51.246 ERROR 9524 --- [ent-executor-19] com.alibaba.nacos.common.remote.client.grpc.GrpcClient : [1660525414478_127.0.0.1_52669]Error to process server push response: {"headers":{},"requestId":"241","serviceInfo":{"name":"shop","groupName":"DEFAULT_GROUP","clusters":"","cacheMillis":10000,"hosts":[{"ip":"192.168.2.104","port":9086,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"DEFAULT","serviceName":"DEFAULT_GROUP@@shop","metadata":{"preserved.register.source":"SPRING_CLOUD"},"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000,"instanceHeartBeatInterval":5000}],"lastRefTime":1660525431244,"checksum":"","allIPs":false,"reachProtectionThreshold":false,"valid":true},"module":"naming"}

原因:使用的是spring-cloud-starter-alibaba-nacos-discovery中默认nacos-client,在nacos官网中查询配置 https://nacos.io/zh-cn/docs/2.0.0-compatibility.html

解决方法:在pom.xml中修改配置,如下:

<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <version>2.1.5.RELEASE</version> <exclusions> <exclusion> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <version>2.1.5.RELEASE</version> <exclusions> <exclusion> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> <version>2.0.0-BETA</version> </dependency>

标签:grpc,true,nacos,alibaba,client,报错,com,cloud
From: https://www.cnblogs.com/luozili/p/16587067.html

相关文章