关于Nacos中下线服务时,下线报错选举Leader失败问题的解决:com.alibaba.nacos.core.distributed.raft.exception.NoLeaderException: The Raft Group [naming_instance_metadata] did not find the Leader node

本文将介绍如何解决 com.alibaba.nacos.core.distributed.raft.exception.NoLeaderException: The Raft Group [naming_instance_metadata] did not find the Leader node 错误。

Nacos注册中心有一个微服务有多台实例的时候,点击一个实例下线操作,报错caused: errCode: 500, errMsg: do metadata operation failed ;

caused: com.alibaba.nacos.consistency.exception.ConsistencyException: com.alibaba.nacos.core.distributed.raft.exception.NoLeaderException: The Raft Group [naming_instance_metadata] did not find the Leader node;
caused: com.alibaba.nacos.core.distributed.raft.exception.NoLeaderException: The Raft Group [naming_instance_metadata] did not find the Leader node;

解决办法:

Nacos 采用 raft 算法来计算 Leader,并且会记录前一次启动的集群地址,所以当我们自己的服务器 IP 改变时(这里特指自己学习时,在本地启动的同学,因为有时候我们的网络环境会变的 … WIFI,所以 IP 地址也经常变化),会导致 raft 记录的集群地址失效,导致选 Leader 出现问题,只要删除 Nacos 根目录下 data 文件夹下的 protocol 文件夹即可。

锲而舍之,朽木不折;锲而不舍,金石可镂。——《荀子·劝学》
1 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号