k8s报错解决思路
问题1
1.报错信息如下
[root@ken1 ~]# kubectl get po
The connection to the server 192.168.64.11:6443 was refused - did you specify the right host or port?
解决思路:
1.首先检查kubelet以及dockers是否启动
2.检查交换分区是否关闭
本机是因为交换分区没有关闭造成的,在/etc/fstab文件中禁用重启系统即可
[root@ken1 ~]# free -h
total used free shared buff/cache available
Mem: 1.8G 188M 1.0G 8.6M 593M 1.4G
Swap: 2.0G 0B 2.0G
[root@ken1 ~]# vim /etc/fstab
[root@ken1 ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Aug 14 15:30:02 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=5ab6cfa4-d753-4d73-b3d6-ebf408b58b56 /boot xfs defaults 0 0
#/dev/mapper/cl-swap swap swap defaults 0 0
再次查看,问题解决
[root@ken1 ~]# kubectl get no
NAME STATUS ROLES AGE VERSION
ken1 Ready master 3d15h v1.15.2
ken2 Ready <none> 3d15h v1.15.2
ken3 Ready <none> 3d15h v1.15.2
==============================================================================
问题2
节点加入集群中报如下的错误
[root@ken2 ~]# kubeadm join 192.168.232.199:6443 --token 5fsbj7.3iobmze5ow8jcz4w --discovery-token-ca-cert-hash sha256:c17bcdcf9b65fef975527d3b02d9cc22621b77916a974a35b112fc5639cb4e77
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.1. Latest validated version: 18.09
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.15" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Activating the kubelet service
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
[kubelet-check] Initial timeout of 40s passed.
error execution phase kubelet-start: error uploading crisocket: timed out waiting for the condition
解决办法
在从节点执行如下的命令
[root@ken2 ~]# kubeadm reset
[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] Are you sure you want to proceed? [y/N]: y
[preflight] Running pre-flight checks
W0820 16:03:33.400935 56927 removeetcdmember.go:79] [reset] No kubeadm config, using etcd pod spec to get data directory
[reset] No etcd config found. Assuming external etcd
[reset] Please, manually reset etcd to prevent further issues
[reset] Stopping the kubelet service
[reset] Unmounting mounted directories in "/var/lib/kubelet"
[reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
[reset] Deleting contents of stateful directories: [/var/lib/kubelet /etc/cni/net.d /var/lib/dockershim /var/run/kubernetes]
The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually.
For example:
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.
The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.
然后根据提示执行下面的命令
[root@ken2 ~]# iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
再次加入即可成功
======================================================================
Continue Reading
k8s报错解决思路的更多相关文章
- OOS 预览报错解决思路
预览报错解决思路: 官方链接:https://docs.microsoft.com/zh-cn/officeonlineserver/office-online-server :> 查看服务器内 ...
- k8s报错解决
. Jul :: lab3 etcd[]: the server is already initialized as member before, starting as etcd member... ...
- PA模块报错-实际返回的行数超出请求的行数(分析标准FORM报错解决思路)
录入预算报错时报错: 分析:这个错误是select into 语句返回多行的结果,但具体在哪? 两种方法查找,trace 或者debug 1.trace 启用调试 获取trace文件 -bash-3. ...
- 在vue中使用lang="scss"出现报错解决思路
最近在学习vue框架,使用lang="scss" 出现如下错误: This dependency was not found: * !!vue-style-loader!css-l ...
- dubbo配置文件报错解决思路
导入dubbo项目到Eclipse,配置文件报了如下异常: Multiple annotations found at this line: - cvc-complex-type.2.4.c: The ...
- MacOS 导入MySQLdb 报错解决思路(解决ImportError: this is MySQLdb version (1, 2, 3, 'beta', 1), but _mysql is version (1, 2, 5, 'final', 1))
cd /Library/Python/2.7/site-packages ls rm -rf MySQL_python-1.2.5-py2.7.egg-info 然后重新import 即可
- CentOS 6.5 Maven 编译 Apache Tez 0.8.3 踩坑/报错解决记录
最近准备学习使用Tez,因此从官网下载了最新的Tez 0.8.3源码,按照安装教程编译使用.平时使用的集群环境是离线的,本打算这一次也进行离线编译,无奈一编译就开始报缺少jar包的错,即使手动下载ja ...
- sphinx :undefined reference to `libiconv' 报错解决办法
sphinx :undefined reference to `libiconv' 报错解决办法 2013-11-30 21:45:39 安装sphinx时不停报错...郁闷在make时报错,错误 ...
- redis运用连接池报错解决
redis使用连接池报错解决redis使用十几小时就一直报异常 redis.clients.jedis.exceptions.JedisConnectionException: Could not g ...
随机推荐
- 遍历数组,对象和JSON
遍历数组 var arr2 = [3,4,5,6,7,8]; //第一种方法 for(var i =0;i<arr.length;i++){ console.log(arr2[i]); } // ...
- three.js 利用uv和ThreeBSP制作一个快递柜
最近有three网友,问我要不要学习blender,其实我感觉学习一下也无妨,不过花大量时间精通,尚可不必,术业有专攻给别人留一条路吧,哈哈.那我我们就是用ThreeBSP和uv贴图的知识来制作一个定 ...
- PAT 2-05. 求集合数据的均方差(15)
题目意思:求N个给定整数的均方差. 求平均值需要先转化为double类型,如果没转化会损失精度,造成错误. 代码如下: #include<iostream> #include<cma ...
- linux tmpfs及消耗内存脚本
一.tmpfs介绍 tmpfs是一种虚拟内存文件系统,正如这个定义它最大的特点就是它的存储空间在VM里面VM是由linux内核里面的vm子系统管理的东西,现在大多数操作系统都采用了虚拟内存管理机制VM ...
- python numpy常用的数学和统计函数
numpy模块的核心就是基于数组的运算,相比于列表和其他数据结构,数组的运算效率是最高的.在统计分析和挖掘过程中,经常会使用到numpy模块的函数,以下是常用的数学函数和统计函数: 常数p就是圆周率 ...
- 精讲响应式WebClient第5篇-请求超时设置与异常处理
本文是精讲响应式WebClient第5篇,前篇的blog访问地址如下: 精讲响应式webclient第1篇-响应式非阻塞IO与基础用法 精讲响应式WebClient第2篇-GET请求阻塞与非阻塞调用方 ...
- 开源搜索引擎排名第一,Elasticsearch是如何做到的?
一.引言 随着移动互联网.物联网.云计算等信息技术蓬勃发展,数据量呈爆炸式增长.如今我们可以轻易得从海量数据里找到想要的信息,离不开搜索引擎技术的帮助. 作为开源搜索引擎领域排名第一的 Elast ...
- ssm框架之springMVC拦截器
1拦截器概述 1.1什么是拦截器? springMVC中的拦截器(Interceptor)类似于servlet中的过滤器(Filter),它主要用于拦截用户请求并作相应的处理.例如通过拦截器可以进行权 ...
- 面经手册 · 第8篇《LinkedList插入速度比ArrayList快?你确定吗?》
作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.前言 你以为考你个数据结构是要造火箭? 汽车75马力就够奔跑了,那你怎么还想要2.0涡轮+ ...
- NGUI List优化
腾讯是如何做 Unity 手游性能优化的 https://juejin.im/entry/5774af485bbb50005925a3b1 Unity - NGUI - 优化ScrollView的一些 ...