k8s故障记录
k8s 记录 故障
2023-09-14 09:01:13 时间
一、etcd故障修改
1、利用已存活的etcd做个备份
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.112.110:2379" snapshot save snapshot.db
2、从集群中剔除有问题的节点
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.112.110:2379,https://192.168.112.111:2379,https://192.168.112.112:2379" member list
3、删除掉坏的节点
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.112.110:2379,https://192.168.112.111:2379,https://192.168.112.112:2379" member remove 6627a32423113ab8
4、修改坏掉节点的配置文件
如果是旧机器,请先清除etcd的数据存储目录里面的文件。
-initial-cluster-state 由"new" 改成"existing"
5、在启动新节点之前,必须把新节点接入集群
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.112.110:2379,https://192.168.112.111:2379,https://192.168.112.112:2379" member add etcd-3 --peer-urls=https://192.168.112.112:2380
6、启动节点
systemctl start etcd
7、再次检查集群状态
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.112.110:2379,https://192.168.112.111:2379,https://192.168.112.112:2379" endpoint health https://192.168.112.111:2379 is healthy: successfully committed proposal: took = 17.633542ms https://192.168.112.112:2379 is healthy: successfully committed proposal: took = 18.544015ms https://192.168.112.110:2379 is healthy: successfully committed proposal: took = 19.061029ms
二、harbor私有仓库引起rancher集群报错
1、在master节点上起了一个harbor仓库,rancher访问不了
相关文章
- 从零开始入门 K8s | 调度器的调度流程和算法介绍
- k8s 安装redis-operator并以operator方式部署redis-standalone redis-cluster集群完整操作记录
- k8s安装工具:sealos设计原理及离线包结构分析
- 基于rancher在线安装k8s集群
- k8s:服务发现Service
- k8s插件说明:CoreDNS、Ingress Controller、Federation、Prometheus、ELK
- 【GO】k8s 管理系统项目23[前端部分–工作负载-Pod]
- k31.第十三章 K8s高级篇-中间件容器化及Helm (二)
- k8s 之 声明式 API
- K8S 笔记(成功实验)——筑梦之路
- k8s(ubuntu)单机搭建部署记录——筑梦之路
- 【云原生】K8s pod 动态弹性扩缩容 HAP(metrics-server)
- 【云原生】Flink on k8s 讲解与实战操作
- 【K8S系列】第七讲:有状态服务 VS 无状态服务
- k8s学习之路 | Day3 跟着官方体验 Minikube
- k8s的CNI网络插件