简体   繁体   English

如何更新etcd成员列表

[英]how to update the etcd member list

my cluster have 3 master node, now I have shutdown 1 master node, then I check the member from etcd database:我的集群有 3 个主节点,现在我关闭了 1 个主节点,然后我从 etcd 数据库中检查成员:

[root@fat001 bin]# ETCDCTL_API=3 /opt/k8s/bin/etcdctl member list
56298c42af788da7, started, azshara-k8s02, https://172.19.104.230:2380, https://172.19.104.230:2379
5ab2d0e431f00a20, started, azshara-k8s01, https://172.19.104.231:2380, https://172.19.104.231:2379
84c70bf96ccff30f, started, azshara-k8s03, https://172.19.150.82:2380, https://172.19.150.82:2379

still show 3 nodes started.仍然显示 3 个节点已启动。 why the etcd did not refresh the node status?为什么etcd没有刷新节点状态? what should I do to update the etcd status to the latest?我应该怎么做才能将etcd状态更新到最新? is it possible to refresh the status manually?是否可以手动刷新状态? the kube.netes version is 1.15.x . kube.netes 版本是1.15.x

If you delete a node that was in a cluster, you should manually delete it from the etcd also ie by doing 'etcdctl member remove 84c70bf96ccff30f '.如果你删除了集群中的一个节点,你应该手动从 etcd 中删除它,也就是通过执行'etcdctl member remove 84c70bf96ccff30f '。

Make sure that etcd container is no longer running on the failed node, and that the node does not contain any data anymore:确保 etcd 容器不再在故障节点上运行,并且该节点不再包含任何数据:

rm -rf /etc/kubernetes/manifests/etcd.yaml /var/lib/etcd/

crictl rm "$CONTAINER_ID"

The commands above will remove the static-pod for etcd and data-directory /var/lib/etcd on the node.Of course, you can also use the kubeadm reset command as an alternative.上面的命令将删除节点上 etcd 的静态 pod 和数据目录 /var/lib/etcd。当然,您也可以使用kubeadm reset命令作为替代。 However, it also will remove all Kube.netes-related resources and certificates from this node.但是,它也会从此节点中删除所有与 Kube.netes 相关的资源和证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM