其他分享
首页 > 其他分享> > etcd查看leader节点

etcd查看leader节点

作者:互联网

etcd查看集群leader的节点


  1. 安装etcdctl
  2. 具体命令如下
    <root@SYS-OPS-ETCD01 ~># etcdctl -w table --cert /etc/kubernetes/pki/etcd/peer.crt --key /etc/kubernetes/pki/etcd/peer.key --cacert /etc/kubernetes/pki/etcd/ca.crt --endpoints https://10.1.0.182:2379 endpoint status --cluster
    +-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    |        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
    +-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
    | https://10.1.0.181:2379 | 2c8cf085f70a48f7 |   3.4.3 |  413 MB |     false |      false |        68 | 4106191951 |         4106191951 |        |
    | https://10.1.0.180:2379 | 6d8112d8e415d2b5 |   3.4.3 |  413 MB |     false |      false |        68 | 4106191955 |         4106191954 |        |
    | https://10.1.0.182:2379 | a8a882b8d519b039 |   3.4.3 |  413 MB |      true |      false |        68 | 4106191957 |         4106191957 |        |
    +-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
  3. 查看节点列表
    <root@SYS-OPS-ETCD01 ~># etcdctl -w table --cert /etc/kubernetes/pki/etcd/peer.crt --key /etc/kubernetes/pki/etcd/peer.key --cacert /etc/kubernetes/pki/etcd/ca.crt --endpoints https://10.1.0.182:2379 member list
    +------------------+---------+--------+-------------------------+-------------------------+------------+
    |        ID        | STATUS  |  NAME  |       PEER ADDRS        |      CLIENT ADDRS       | IS LEARNER |
    +------------------+---------+--------+-------------------------+-------------------------+------------+
    | 2c8cf085f70a48f7 | started | infra1 | https://10.1.0.181:2380 | https://10.1.0.181:2379 |      false |
    | 6d8112d8e415d2b5 | started | infra0 | https://10.1.0.180:2380 | https://10.1.0.180:2379 |      false |
    | a8a882b8d519b039 | started | infra2 | https://10.1.0.182:2380 | https://10.1.0.182:2379 |      false |
    +------------------+---------+--------+-------------------------+-------------------------+------------+

     

标签:10.1,false,etcd,--,节点,2379,https,leader
来源: https://www.cnblogs.com/apink/p/15683226.html