由于规划问题,通过rancher安装的k8s不完美,决定重装。将所有东西都卸载赶紧后 #####docker卸载清除:
yum remove docker* -y
rm /var/lib/docker -fr
rm /var/run/docker -fr
#####k8s清除:
kubeadmin reset
再次通过rancher安装k8s后,一直报错起不来
[etcd] Failed to bring up Etcd Plane: [etcd] Etcd Cluster is not health
通过docker ps查看etcd的容器一起在无限重启,使用如下命令查看日志
docker logs etcd
看到日志有提到 本地有保存的member数据,直接还原,找了一番之后发现在/var/lin/etcd/下面还有很多残余数据,看上去像是备份之类的,如下:
直接删掉,再次安装集群,顺利完成 #####ps: 有大佬整理了清理k8s脚本:
docker rm -f $(sudo docker ps -aq);
docker volume rm $(sudo docker volume ls -q);
rm -rf /etc/cni \
/etc/kubernetes \
/opt/cni \
/opt/rke \
/run/secrets/kubernetes.io \
/run/calico \
/run/flannel \
/var/lib/calico \
/var/lib/etcd \
/var/lib/cni \
/var/lib/kubelet \
/var/lib/rancher/rke/log \
/var/log/containers \
/var/log/pods \
/var/run/calico
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
rm -f /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db
sudo systemctl restart containerd
sudo systemctl restart docker
评论区