问题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报错解决思路的更多相关文章

  1. OOS 预览报错解决思路

    预览报错解决思路: 官方链接:https://docs.microsoft.com/zh-cn/officeonlineserver/office-online-server :> 查看服务器内 ...

  2. k8s报错解决

    . Jul :: lab3 etcd[]: the server is already initialized as member before, starting as etcd member... ...

  3. PA模块报错-实际返回的行数超出请求的行数(分析标准FORM报错解决思路)

    录入预算报错时报错: 分析:这个错误是select into 语句返回多行的结果,但具体在哪? 两种方法查找,trace 或者debug 1.trace 启用调试 获取trace文件 -bash-3. ...

  4. 在vue中使用lang="scss"出现报错解决思路

    最近在学习vue框架,使用lang="scss" 出现如下错误: This dependency was not found: * !!vue-style-loader!css-l ...

  5. dubbo配置文件报错解决思路

    导入dubbo项目到Eclipse,配置文件报了如下异常: Multiple annotations found at this line: - cvc-complex-type.2.4.c: The ...

  6. 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 即可

  7. CentOS 6.5 Maven 编译 Apache Tez 0.8.3 踩坑/报错解决记录

    最近准备学习使用Tez,因此从官网下载了最新的Tez 0.8.3源码,按照安装教程编译使用.平时使用的集群环境是离线的,本打算这一次也进行离线编译,无奈一编译就开始报缺少jar包的错,即使手动下载ja ...

  8. sphinx :undefined reference to `libiconv' 报错解决办法

    sphinx :undefined reference to `libiconv' 报错解决办法   2013-11-30 21:45:39 安装sphinx时不停报错...郁闷在make时报错,错误 ...

  9. redis运用连接池报错解决

    redis使用连接池报错解决redis使用十几小时就一直报异常 redis.clients.jedis.exceptions.JedisConnectionException: Could not g ...

随机推荐

  1. 前端 go.js 流程图基于vue开发项目案例

    一.流程图效果 最近一段时间在研究go.js,它是一款前端开发画流程图的一个插件,也是一个难点,要说为什么是难点,首先,它是依赖画布canvas知识开发.其次,要依赖于内部API开发需求,开发项目需求 ...

  2. eric4 打包文件

    在.py 工程 所在目录: 按住shift,鼠标右键,在此处打开cmd或shell,然后如下操作 1.打包成文件夹 pyinstaller lrs.py 2.打包成 单文件 pyinstaller - ...

  3. python 常用函数集合

    1.常用函数     round() :  四舍五入         参数1:要处理的小数         参数2:可选,如果不加,就是不要小数,如果加,就是保留几位小数     abs() :绝对值 ...

  4. Wireshark中的Checksum: 0x90c5 [validation disabled]问题

    Wireshark中的Checksum: 0x90c5 [validation disabled]问题 废话不多说先上问题图: 这是我在做关于DNS协议PPT的时候出现的协议树第五项展开结果,可以发现 ...

  5. C语言复习-字符串与指针

    C语言复习-字符串与指针 例一: [字符串处理 去除C代码中的注释] C/C++代码中有两种注释,/* */和//.编译器编译预处理时会先移除注释.就是把/*和*/之间的部分去掉,把//以及之后的部分 ...

  6. ssm-springboot实现修排名再顺序排的主要代码

    排序改为2,结果如下: package com.zhetang.controller; import com.core.vo.JsonResult; import com.utils.PageResu ...

  7. 03.AOF持久化机制配置与工作流程

    一.AOF持久化的配置 配置文件redis.conf,AOF持久化默认是关闭的,默认是打开RDB持久化 appendonly yes     二.工作流程: 打开AOF持久化机制之后,redis每次接 ...

  8. Apache Tika实战

    Apache Tika实战 Tika 简介 Apache Tika 是一个内容分析工具包,可以检测上千种文件类型,并提取它们的元数据和文本.tika在设计上十分精巧,单一的接口使它易于使用,在搜索引擎 ...

  9. 基于Rust-vmm实现Kubernetes运行时

    随着容器及K8s的广泛使用,越来越多的容器安全与隔离问题被暴露出来,如:容器逃逸.水平攻击.DDos攻击等严重威胁了办公和生产环境的安全与稳定,影响了业务的正常运行.安全容器技术孕育而生,产生了kat ...

  10. day41:MYSQL:select查询练习题

    目录 1.表结构 2.创建表和插入数据 3.习题 1.表结构 2.建表和插入数据 # 创建班级表 create table class( cid int primary key auto_increm ...