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

Is the following output of "etcdctl member list" correct and ETCD cluster is in good state?

我是 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

但是让我有点困惑的是所有 3 个 etcd 主机的 false。有人可以帮我解释一下这是否意味着 none 目前是大师?如果这个输出是正确的

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 版引入了一个新的节点状态“Learner”,它作为 non-voting 成员加入集群,直到赶上领导者的日志。这意味着学习者仍然会收到来自领导者的所有更新,但它不计入领导者用来评估同伴活跃度的法定人数。 learner 在升级之前仅作为备用节点。这种对仲裁的宽松要求在成员重新配置和操作安全期间提供了更好的可用性。

所以您的 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 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+