k8s学习笔记-k8s安装步骤
作者:互联网
问题:初始化失败后,如何重新初始化
如果初始化失败后,直接初始化,回出现下图的错误信息
过滚到初始化前的状态
1.手动删除
- 删除/etc/kubernetes/文件夹下的所有文件
- 删除$HOME/.kube文件夹
- 删除/var/lib/etcd文件夹
[root@k8s-master ~]# rm -rf /etc/kubernetes/*
[root@k8s-master ~]# rm -rf ~/.kube/*
[root@k8s-master ~]# rm -rf /var/lib/etcd/*
4.停用上图中的端口号
[root@k8s-master ~]# lsof -i :6443|grep -v "PID"|awk '{print "kill -9",$2}'|sh
[root@k8s-master ~]# lsof -i :10251|grep -v "PID"|awk '{print "kill -9",$2}'|sh
[root@k8s-master ~]# lsof -i :10252|grep -v "PID"|awk '{print "kill -9",$2}'|sh
[root@k8s-master ~]# lsof -i :10250|grep -v "PID"|awk '{print "kill -9",$2}'|sh
[root@k8s-master ~]# lsof -i :2379|grep -v "PID"|awk '{print "kill -9",$2}'|sh
[root@k8s-master ~]# lsof -i :2380|grep -v "PID"|awk '{print "kill -9",$2}'|sh
2.使用kubeadmin重设环境
[root@k8s-master ~]# kubeadm reset
标签:步骤,PID,笔记,kill,print,master,k8s,root 来源: https://www.cnblogs.com/zhang790/p/16698661.html