etcd故障节点

root@k8s-master1 \~# kubectl get cs

NAME STATUS MESSAGE ERROR

controller-manager Healthy ok

scheduler Healthy ok

etcd-1 Healthy {"health":"true"}

etcd-0 Healthy {"health":"true"}

etcd-2 Unhealthy HTTP probe failed with statuscode: 503

ETCDCTL_API=3 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints="https://192.168.233.91:2379,https://192.168.233.93:2379,https://192.168.233.94:2379" endpoint health --write-out=table

1.将有故障的etcd节点remove出集群:

ETCDCTL_API=3 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints="https://192.168.233.91:2379,https://192.168.233.93:2379,https://192.168.233.94:2379" --write-out=table member list

cf4f326398a30bd2

86ec40d44e54cf0a

/opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints="https://192.168.233.91:2379,https://192.168.233.93:2379,https://192.168.233.94:2379" member remove 故障节点的id

2、来到故障节点

rm -rf /var/lib/etcd/default.etcd/member/

修改etcd配置文件,将下面new修改为:

vim /opt/etcd/cfg/etcd

修改前:

ETCD_INITIAL_CLUSTER_STATE="new"

修改后:

ETCD_INITIAL_CLUSTER_STATE="existing"

3、重新加入etcd集群:

/opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints="https://192.168.233.91:2379,https://192.168.233.93:2379,https://192.168.233.94:2379" member add etcd-2 --peer-urls=https://192.168.233.94:2380

4、重启etcd故障节点

相关推荐
分布式存储与RustFS9 小时前
镜像仓库的层别堆本地盘:用 RustFS 给 Docker Registry 当 S3 后端
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
孙克旭_21 小时前
云原生基础之Containerd容器运行时
运维·云原生
分布式存储与RustFS21 小时前
RustFS 自建对象存储实战目录:110 篇按场景分类(持续更新)
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
无人生还别怕2 天前
如何搭建docker仓库(轻量级)registry
linux·运维·docker·云原生·容器·registry·openanolisos
分布式存储与RustFS2 天前
Hudi 表想摆脱 HDFS 绑定?用 Spark + Hudi 直接写进 RustFS
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
逐流人2 天前
DevOps 入门实战(一):从 CI/CD 概念到 Jenkins 自动构建部署
运维·云原生·云计算·jenkins·devops
阿里云云原生2 天前
让复杂任务由团队完成:阿里云 AgentCore 多 Agent 协作架构及实践
云原生
YYYing.2 天前
【K8s系列 (一) 】Docker与容器(上篇)
docker·云原生·容器·kubernetes
阿里云云原生3 天前
阿里云可观测 2026 年 10 月产品动态
云原生
阿里云云原生3 天前
用 Nacos 3.3.0 ARD 让 Agent 按任务发现工具和 Skill
云原生