苏打

etcd节点故障处理

2020-01-15 · 2 min read
etcd

客户集群一个master节点上的etcd服务down了,一直重启。最后通过将坏节点移除和重新添加解决问题。
首先查看坏节点的 id

[root@vm192-168-0-6 ~]# ETCDCTL_API=3 etcdctl --endpoints=http://192.168.0.2:2379 member list
1d7fee1c4ff0810b, started, etcd-192.168.0.28, http://192.168.0.28:4001, http://192.168.0.28:2379
78dc844ab5290b06, started, etcd-192.168.0.38, http://192.168.0.38:4001, http://192.168.0.38:2379
d84ca7385ba39041, started, etcd-192.168.0.2, http://192.168.0.2:4001, http://192.168.0.2:2379

移除坏的etcd 成员 etcd-192.168.0.28

ETCDCTL_API=3 etcdctl --endpoints=http://192.168.0.2:2379  member remove  1d7fee1c4ff0810b

接下来停掉 etcd-192.168.0.28 服务,并清空数据目录。然后重新添加 etcd-192.168.0.28 节点

ETCDCTL_API=3 etcdctl --endpoints=http://192.168.0.2:2379  member add etcd-192.168.0.28 --peer-urls=http://192.168.0.28:4001 --endpoints=http://192.168.0.28:2379 

加入成功后,重启 etcd-192.168.0.28 服务