首页 > 其他分享 >nacos报错:Nacos cluster is running with 1.X mode, can't accept gRPC request temporarily

nacos报错:Nacos cluster is running with 1.X mode, can't accept gRPC request temporarily

时间:2023-04-27 15:15:29浏览次数:61  
标签:temporarily gRPC nacos 报错 mode NamingGrpcClientProxy com 双写

nacos报错:Nacos cluster is running with 1.X mode, can't accept gRPC request temporarily

nacos报错如下:

Caused by: com.alibaba.nacos.api.exception.NacosException: Request nacos server failed: 
        at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:227)
        at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.deregisterService(NamingGrpcClientProxy.java:127)
        ... 49 common frames omitted
        
Caused by: com.alibaba.nacos.api.exception.NacosException: Nacos cluster is running with 1.X mode, can't accept gRPC request temporarily. Please check the server status or close Double write to force open 2.0 mode. Detail https://nacos.io/en-us/docs/2.0.0-upgrading.html.
        at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:219)

解决方法:

关闭nacos双写。

在2.0.3版本默认开启双写,只要nacos集群其中一个节点挂掉,剩余节点如果不将这个节点从地址列表中移除,只要重启便会出现服务降级;另外在并发部署的情况下,也有可能出现服务降级。

关闭双写会关闭运行中服务降级的入口,所以2.x服务运行稳定后一定要关闭双写。

否则在一定的场景下可能出现服务降级导致部分节点不可用。

  • nacos查看节点监控:
curl -X GET 'nacos的ip:端口/nacos/v1/ns/upgrade/ops/metrics'

结果如下:

可以看到 isDoubleWriteEnabled = true,双写是开启的。

[logs@xx logs]$ curl -X GET 'nacos的ip:端口/nacos/v1/ns/upgrade/ops/metrics'
upgraded                       = false
isAll20XVersion                = true
isDoubleWriteEnabled           = true
doubleWriteDelayTaskCount      =     0
serviceCountV1                 =     0
instanceCountV1                =     0
serviceCountV2                 =     0
instanceCountV2                =    16
subscribeCountV2               =     0
responsibleServiceCountV1      =     0
responsibleInstanceCountV1     =     0
ephemeralServiceCountV2        =     0
persistentServiceCountV2       =     0
ephemeralInstanceCountV2       =     0
persistentInstanceCountV2      =     0
service.V1.not.in.V2           =
service.V2.not.in.V1           =

nacos关闭双写:

 curl -X PUT 'nacos的ip:端口/nacos/v1/ns/operator/switches?entry=doubleWriteEnabled&value=false'

如果报错403,如下:

"status":403,"error":"Forbidden","message":"unknown user!

就需要就加上账号密码:

 curl -X PUT 'nacos的ip:端口/nacos/v1/ns/operator/switches?entry=doubleWriteEnabled&value=false&username=xx&password=xx'

显示ok,关闭双写成功,重新启动服务即可。

参考资料:

https://nacos.io/zh-cn/blog/xiaomi-scale.html

https://zhuanlan.zhihu.com/p/482212172

标签:temporarily,gRPC,nacos,报错,mode,NamingGrpcClientProxy,com,双写
From: https://www.cnblogs.com/expiator/p/17358944.html

相关文章

  • iis搭建discuz7.2 的曲折经历 y以及各种报错的处理
    环境windowsserver 2008R2  mysql 5.1.73 iis6 php5.6安装PHP解压PHP,我给的路径是C:\Users\Administrator\Desktop\php,大伙儿随意把php.ini-production改名为php.ini(用于开发环境的话,就改那个development)修改扩展路径extension_dir="./ext"启用MySQL扩展(即去......
  • 使用 youth5201314:banner 库时出现 ViewPager 或 xandroid 报错
    使用youth5201314:banner这个库的1.4.10版本开发时,Build时报错找不到android.support.v4.view.ViewPager的类文件找不到androidx.fragment.app.Fragment的类文件需要在Project的gradle.properties配置文件中加一行,用于自动迁移第三方库android.enableJetifier=......
  • uniapp脚手架项目抖音小程序中使用了uView框架中的IndexList 索引列表组件报错uni.req
    解决办法如果您是vue-cli模式的项目,还需要在项目根目录的vue.config.js文件中进行如下配置://vue.config.js,如没有此文件则手动创建module.exports={transpileDependencies:['uview-ui']}......
  • Java8使用Stream API转换Map遇到的2种异常报错和解决思路
    问题java8提供了StreamAPI,配合Lambda表达式,让开发者能对集合对象进行便利、高效的操作。在日常业务开发中,有个经常用到的场景是将List类型对象转换为Map类型对象,方便后续操作。在java8之前,这种转换需要先new一个Map对象,遍历list然后通过Map#put来初始化。使用java8后,可方便的......
  • macOS下生成pdf报错:No wkhtmltopdf executable found
    重点:不要在PyCharm里直接安装 wkhtmltopdf!!!从wkhtmltopdf官网下载macOS下的pdg安装包,下载页面:wkhtmltopdf下载完后安装,通过which找到安装路径importpdfkitconfig=pdfkit.configuration(wkhtmltopdf='/usr/local/bin/wkhtmltopdf')pdfkit.from_string("abc","0.pdf&quo......
  • 服务器断电后启动失败报错:Generating /run/initramfs/rdsosreport.txt
    一、现象服务器断电,然后启动时发现起不来,连接显示器发现报错,如下所示: 原因:一般是服务器突然断电导致文件损坏所致,只要修复回去就好二、解决过程2.1寻找/dev/*-root文件说明: /dev/mapper目录下一般有三个文件,其中 centos-root是我们需要修复的。有些服务器的文件名称......
  • 解决 c3p0报错 Establishing SSL connection without server's identity verification
    解决c3p0报错EstablishingSSLconnectionwithoutserver'sidentityverificationisnotrecommended  ?useSSL=false<c3p0-config><default-config><propertyname="driverClass">com.mysql.jdbc.Driver</property>......
  • Correct the classpath of your application so that it contains a single, compatib
    1.背景有时候引入包有冲突,比如在Maven项目中的不同模块多次重复引入等这里遇到的问题是重复映入了如下包:<dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.0-RELEASE</vers......
  • 解决Python中报错RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.1.0)/c
      在运行requests包时,出现了以下报错信息:RequestsDependencyWarning:urllib3(1.26.9)orchardet(5.1.0)/charset_normalizer(2.0.12)doesn'tmatchasupportedversion!warnings.warn("urllib3({})orchardet({})/charset_normalizer({})doesn'tmatchasu......
  • python安装pillow报错
    Fatalerrorinlauncher:Unabletocreateprocessusing'"D:\ProgramFiles\Python311\python.exe" "D:\ProgramFiles\Python311\Scripts\pip.exe"installpillow':??????????? 解决:cmd窗口执行32位:python3-mpipinstall--up......