K8S基本操作-32-檢查ETCD server 上的各種狀態配置
用 PS 指令檢查 etcd 的各個配置檔案路徑與參數
有些情況 Kubectl 工具未安裝在 etcd server 上,所以必須要手動用 ps 指令檢查參數:
ps aux|grep etcd
結果:
etcd 808 0.0 0.0 11218624 56044 ? Ssl 01:58 0:44 /usr/local/bin/etcd --name etcd-server --data-dir=/var/lib/etcd-data --cert-file=/etc/etcd/pki/etcd.pem --key-file=/etc/etcd/pki/etcd-key.pem --peer-cert-file=/etc/etcd/pki/etcd.pem --peer-key-file=/etc/etcd/pki/etcd-key.pem --trusted-ca-file=/etc/etcd/pki/ca.pem --peer-trusted-ca-file=/etc/etcd/pki/ca.pem --peer-client-cert-auth --client-cert-auth --initial-advertise-peer-urls https://192.4.181.11:2380 --listen-peer-urls https://192.4.181.11:2380 --advertise-client-urls https://192.4.181.11:2379 --listen-client-urls https://192.4.181.11:2379,https://127.0.0.1:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster etcd-server=https://192.4.181.11:2380 --initial-cluster-state new
root 1376 0.0 0.0 13444 1072 pts/1 S+ 02:54 0:00 grep etcd
Etcdctl 觀察分散式 ETCD 節點
有時候 ETCD 節點存在好幾個,作為安全起見,可以用以下方式在 ETCD 節點上查看:
ETCDCTL_API=3 etcdctl \
--endpoints=https://127.0.0.1:2379 \
--cacert=/etc/etcd/pki/ca.pem \
--cert=/etc/etcd/pki/etcd.pem \
--key=/etc/etcd/pki/etcd-key.pem \
member list
結果:
4e8233dc38e9a3cd, started, etcd-server, https://192.4.181.11:2380, https://192.4.181.11:2379, false
我們可以看到,只有一個 IP ,這就是一個 Node 。