gpt4 book ai didi

kubernetes - 以下 "etcdctl member list"的输出是否正确且 ETCD 集群状态良好?

转载 作者:行者123 更新时间:2023-12-04 15:58:29 26 4
gpt4 key购买 nike

我是 k8s 的新手,我正在尝试构建一个 etcd 集群。现在我已经完成了所有步骤并获得了所需的输出。

ubuntu@controller0:/etc/systemd/system$ sudo ETCDCTL_API=3 etcdctl member list --endpoints=https://10.240.0.10:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kubernetes.pem --key=/etc/etcd/kubernetes-key.pem
3a57933972cb5131, started, controller2, https://10.240.0.12:2380, https://10.240.0.12:2379, false
f98dc20bce6225a0, started, controller0, https://10.240.0.10:2380, https://10.240.0.10:2379, false
ffed16798470cab5, started, controller1, https://10.240.0.11:2380, https://10.240.0.11:2379, false
但让我有点困惑的是 false对于所有 3 个 etcd 主机。有人可以帮我解释一下,这是否意味着他们目前都不是大师?如果这个输出是正确的

最佳答案

etcdctl member list --help
NAME:
member list - Lists all members in the cluster

USAGE:
etcdctl member list [flags]

DESCRIPTION:
When --write-out is set to simple, this command prints out comma-separated member lists for each endpoint.
The items in the lists are ID, Status, Name, Peer Addrs, Client Addrs, Is Learner.
从上面可以看出,最后一列是 Is Learner这对于您的所有节点都是错误的。 ETCD 3.4 版引入了一个新的节点状态“学习者”,它作为非投票成员加入集群,直到它 catch 领导者的日志。这意味着学习者仍然会收到来自领导者的所有更新,但它不计入法定人数,领导者使用法定人数来评估对等活跃度。学习者仅作为备用节点直到被提升。这种对法定人数的宽松要求在成员资格重新配置和操作安全期间提供了更好的可用性。
所以你的ETCD集群状态良好。要验证领导者是否存在,请使用以下命令
sudo ETCDCTL_API=3 etcdctl endpoint status --write-out=table --endpoints=https://10.240.0.10:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kubernetes.pem --key=/etc/etcd/kubernetes-key.pem

+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://172.16.2.3:2379 | f15c8d27ccf66395 | 3.4.3 | 2.2 MB | false | false | 6 | 41219 | 41219 | |
| https://172.16.2.6:2379 | be8c6e0b5f5f6157 | 3.4.3 | 2.2 MB | true | false | 6 | 41219 | 41219 | |
| https://172.16.2.7:2379 | 7e7a0308e6c2067f | 3.4.3 | 2.2 MB | false | false | 6 | 41219 | 41219 | |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
ETCD

关于kubernetes - 以下 "etcdctl member list"的输出是否正确且 ETCD 集群状态良好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63433622/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com