nacos-sdk-go v2 报错提示客户端连接不上
标签(空格分隔): nacos
前言
nacos版本:v2
nacos-sdk-go版本:v2
背景:使用nacos-sdk-go来获取配置,发现一直在找缓存目录的文件,但使用openapi可以获取到配置
报错信息
client not connected, current status:STARTING
提示客户端连接失败???
1999-07-03T17:28:05.561+0800 ERROR config_client/config_client.go:208 get config from server error:client not connected, current status:STARTING, dataId=test, group=DEFAULT_GROUP, namespaceId=
1999-07-03T17:28:05.561+0800 ERROR cache/disk_cache.go:101 get config from cache, cacheKey:test@@DEFAULT_GROUP@@, cacheDir:tmp/nacos/cache\config, error:open tmp/nacos/cache\config\test@@DEFAULT_GROUP@@: The system cannot find the path specified.
client not connected, current status:STARTING
解决方案
文档地址:https://nacos.io/zh-cn/docs/v2/upgrading/2.0.0-compatibility.html
原因:Nacos2.0增加了9848,9849端口来进行GRPC通信
docker启动nacos增加相应的端口
docker run --name nacos-standalone -e MODE=standalone -e JVM_XMS=100m -e JVM_XMX=100m -e JVM_XMN=100m -p 8848:8848 -p 9848:9848 -p 9849:9849 -d nacos/nacos-server:latest
标签:cache,nacos,不上,v2,go,config,sdk
From: https://www.cnblogs.com/yanweifeng/p/17525253.html