k8s报错解决

1、

Jul 18 02:25:58 lab3 etcd[5649]: the server is already initialized as member before, starting as etcd member...

https://www.cnblogs.com/ericnie/p/6886016.html

[[email protected] k8s]# systemctl start etcd
Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details

[[email protected] k8s]# journalctl -xe

Jul 18 02:25:58 lab3 etcd[5649]: the server is already initialized as member before, starting as etcd member...

核心语句

raft save state and entries error: open /var/lib/etcd/default.etcd/member/wal/0.tmp: is a directory

解决:

进入相关目录,删除0.tmp,然后就可以启动啦!

删除后,把node3  上的配置的目录全部删除,然后再重新配置。

2、

WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP.

[[email protected] ~]# systemctl status kube-scheduler -l
● kube-scheduler.service - Kubernetes Scheduler Plugin
   Loaded: loaded (/etc/systemd/system/kube-scheduler.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2018-07-19 01:49:06 EDT; 13min ago
     Docs: https://github.com/kubernetes/kubernetes
  Process: 13107 ExecStart=/usr/local/kubernetes/bin/kube-scheduler $KUBE_LOGTOSTDERR $KUBE_LOG_LEVEL $KUBECONFIG $KUBE_SCHEDULER_ARGS (code=exited, status=1/FAILURE)
 Main PID: 13107 (code=exited, status=1/FAILURE)

Jul 19 01:49:06 lab1 systemd[1]: kube-scheduler.service: main process exited, code=exited, status=1/FAILURE
Jul 19 01:49:06 lab1 kube-scheduler[13107]: W0719 01:49:06.562968   13107 options.go:148] WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP.

原因:没有仔细按照文档操作,按照上海的文档配置这一步:生成kubeconfig,我是全部复制进去了,其实分开了好多小步骤,

解决:重新安装,每一步都要复制,不要省事,

3、

问题:

[[email protected] ~]# systemctl status kubelet
● kubelet.service - Kubernetes Kubelet Server
   Loaded: loaded (/etc/systemd/system/kubelet.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2018-07-19 21:38:57 EDT; 3s ago
     Docs: https://github.com/kubernetes/kubernetes
  Process: 3243 ExecStart=/usr/local/kubernetes/bin/kubelet $KUBE_LOGTOSTDERR $KUBE_LOG_LEVEL $KUBELET_CONFIG $KUBELET_HOSTNAME $KUBELET_POD_INFRA_CONTAINER $KUBELET_ARGS (code=exited, status=255)
 Main PID: 3243 (code=exited, status=255)

解决:node节点也安装k8s文件,上海哥的文档 在node加点没有安装k8s ,所以报错

cd /server/software/k8s
wget https://dl.k8s.io/v1.11.0/kubernetes-server-linux-amd64.tar.gz
tar xf kubernetes-server-linux-amd64.tar.gz
cd kubernetes/server/bin
mkdir -pv /usr/local/kubernetes-v1.11.0/bin
cp kube-apiserver kube-controller-manager kube-scheduler kube-proxy kubelet kubectl /usr/local/kubernetes-v1.11.0/bin
ln -sv /usr/local/kubernetes-v1.11.0 /usr/local/kubernetes
cp /usr/local/kubernetes/bin/kubectl /usr/local/bin/kubectl
kubectl version
cd $HOME

4、

问题:

[[email protected] k8s]# kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?

解决:

方法一:

[[email protected] kubernetes]# export KUBECONFIG=/etc/kubernetes/admin.conf        # 这句话是加授权的意思,这个最管用

方法二:

把master节点的配置文件admin.conf  复制到 node节点的 /etc/kubernetes/

然后执行:

rm -rf $HOME/.kube
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get no

5、

报错:

[[email protected] flannel]# kubectl get pods -n kube-system
NAME                    READY     STATUS         RESTARTS   AGE
kube-flannel-ds-4hdsh   0/1       ErrImagePull   0          1m
kube-flannel-ds-7gmwt   0/1       ErrImagePull   0          1m
kube-flannel-ds-cbk5z   0/1       ErrImagePull   0          1m
[[email protected] flannel]# 

解决:等一会,这个启动比较慢,上次启动没起来,吓一跳,过了几分钟就running起来,

[[email protected] flannel]# kubectl get pods -n kube-system
NAME                    READY     STATUS    RESTARTS   AGE
kube-flannel-ds-4hdsh   1/1       Running   0          6m
kube-flannel-ds-7gmwt   1/1       Running   0          6m
kube-flannel-ds-cbk5z   1/1       Running   0          6m

6、

coredns  无法启动,

[[email protected] coredns]# kubectl get pods -n kube-system
NAME                       READY     STATUS              RESTARTS   AGE
coredns-6975654877-d6q9z   0/1       ContainerCreating   0          21s
coredns-6975654877-k48wq   0/1       ContainerCreating   0          21s
kube-flannel-ds-d2tff      1/1       Running             0          3m
kube-flannel-ds-qnnpg      1/1       Running             0          3m
kube-flannel-ds-t2pxx      1/1       Running             0          3m

解决:

配置使用flannel网络kube-flannel.yml,这步要修改网卡,把kube-flannel.yml  里面的- --iface=eth1 修改成自己本机的网卡

7、

[[email protected] ~]# systemctl status etcd
Aug 16 17:01:07 lab1 etcd[9526]: failed to dial d35b4e3738b04cd7 on stream MsgApp v2 (dial tcp 10.1.1.111:2380: getsockopt:...efused)

解决: master的防火墙没有关, 关掉就可以

8、

[[email protected] ~]# kubectl get no
Unable to connect to the server: Forbidden

解决:

实在找不到原因,重启这三台 就好

9、

问题: 创建flnal 后 一会runing  一会挂掉

解决:

安装kube-kube-proxy ,不要选择ipvs模式,centos7环境,ipvs模式在1.11.0不行, 在1.11.1之后就ok了

10、

下面报错,与此同时,测试的数据库也出现了mysql连接问题。

[[email protected] ~]# kubectl get no
E0828 11:06:56.233812    2504 round_trippers.go:169] CancelRequest not implemented
E0828 11:06:56.235504    2504 round_trippers.go:169] CancelRequest not implemented
E0828 11:06:56.235505    2504 round_trippers.go:169] CancelRequest not implemented
E0828 11:06:56.236281    2504 round_trippers.go:169] CancelRequest not implemented
E0828 11:06:56.236765    2504 round_trippers.go:169] CancelRequest not implemented
E0828 11:06:56.236772    2504 round_trippers.go:169] CancelRequest not implemented
E0828 11:06:56.237298    2504 round_trippers.go:169] CancelRequest not implemented

解决:

[[email protected] ~]# 什么都不管用, 第一种情况是云主机之间不畅通,  第二种情况是被黑了,  第一种情况占的大

11、

pod一直处理ContainerCreating 状态

[[email protected] coredns]# kubectl get po -n kube-system
NAME                       READY     STATUS              RESTARTS   AGE
coredns-55f86bf584-4rzwj   0/1       ContainerCreating   0          8s
coredns-55f86bf584-dp8gp   0/1       ContainerCreating   0          8s

解决:

http://www.mamicode.com/info-detail-2310522.html

查看/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt (该链接就是上图中的说明) 是一个软链接,但是链接过去后并没有真实的/etc/rhsm,所以需要使用yum安装:
yum install *rhsm* -y

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem

这两个命令会生成/etc/rhsm/ca/redhat-uep.pem文件.

重启docker
systemctl restart docker

[[email protected] coredns]# docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest
latest: Pulling from rhel7/pod-infrastructure
26e5ed6899db: Pull complete
66dbe984a319: Pull complete
9138e7863e08: Pull complete
Digest: sha256:92d43c37297da3ab187fc2b9e9ebfb243c1110d446c783ae1b989088495db931
Status: Image is up to date for registry.access.redhat.com/rhel7/pod-infrastructure:latest

[[email protected] coredns]# kubectl delete -f .
[[email protected] coredns]# kubectl create -f .
[[email protected] coredns]# kubectl get po -n kube-system
NAME                       READY     STATUS    RESTARTS   AGE
coredns-55f86bf584-4rzwj   1/1       Running   0          5m
coredns-55f86bf584-dp8gp   1/1       Running   0          5m

12、

pod一直处理terminating 状态

使用命令

kubectl delete pods --all --grace-period=0 –force

强制删除

重启 kube-apiserver

重启 kubelet  docker   实在不行就重启系统

重启后如果发现还在就再强制删除

原文地址:https://www.cnblogs.com/effortsing/p/10014623.html

时间: 2024-10-10 11:48:55

k8s报错解决的相关文章

Oracle11g 启动报错ORA-00845: MEMORY_TARGET not supported on this system报错解决

ORA-00845: MEMORY_TARGET not supported on this system报错解决 Oracle启动报错 ORA-00845: MEMORY_TARGET not supported on this system报错解决 SQL> startup ORA-00845: MEMORY_TARGET not supported on this system 查看原本大小 [[email protected] oracle]# df -h|grep shm tmpfs

【Unity3D】生成工程报错解决—UnityEditor.HostView:OnGUI() Error building Player: Couldn't build player because of unsupported data on target platform.

错误 错误1:An asset is marked as dont save, but is included in the build: unityEditor.HostView:OnGUI() 错误2:Building - Failed to write file: sharedassets0.assetsUnityEditor.HostView:OnGUI() 错误3:Error building Player: Couldn't build player because of unsup

quick3.3final版创建项目报错解决

quick3.3final版创建项目报错解决 今天新下载了quick3.3final版,于是安装,创建项目,打开player新建项目如下图 然后点击创建,就发生了如下错误,相信应该有不少朋友会碰到的 首先,这里有两个错误 1.PHP Notice:  Undefined index: extracmd in /Users/wangmeng/Documents/quick-3.3/quick/bin/lib/quick/ProjectCreator.php on line 117 这是117行有未

Eclipse @override报错解决

关键字: eclipse @override 报错 解决 第一种解决方案: @Override是JDK5 就已经有了,但有个小小的Bug,就是不支持对接口的实现,认为这不是Override而JDK6 修正了这个Bug,无论是对父类的方法覆盖还是对接口的实现都可以加上@Override 修改你的eclipse指定的编译器版本在选项里的java compiler中指定版本至少在5.0以上 在myEclipse中改变编译器的方法:Project->Properties->Java Compiler-

Android 工程报错解决 Unable to resolve target 'android-17'

转自:http://www.cnblogs.com/csulennon/p/3705177.html 换了系统后,重新安装了Android SDK和ADT插件,导入之前的工作空间.居然发现所有的Android工程都报错了. 我之前的SDK版本是用的17,升级后用的是19. 1: [2014-05-03 14:56:25 - ThinkBlink] Unable to resolve target 'android-17' 2: [2014-05-03 14:56:26 - Game2048Pub

PHP多次调用Mysql存储过程报错解决办法

PHP多次调用Mysql数据库的存储过程会出现问题,主要问题为存储过程中执行多次SQL语句不能一一释放导致的,网上找了一些解决办法,比如使用 multi_query 然后一个一个释放,但是发现根本不适合我们的项目,我们使用CI框架写的,更多的是使用CI的数据库处理方法.所以只能另辟蹊径. 一次偶然,把Mysql链接方式改成了mysqli,两种不同的PHP连接mysql的扩展,官方在高版本中推荐使用mysqli,结果却奇迹般好了,使用Mysql长连接也行,天意么? PHP多次调用Mysql存储过程

jsp页面中onsubmit="return checklogin();"报错解决办法

选择Window->Preferences->MyEclipse->Validation 去掉方框里的对号,然后Apply 然后点击Yes->然后再点击ok->Yes,就好了,如果你打开了那个出现错误jsp页面的话,请关掉重现打开就ok啦 jsp页面中onsubmit="return checklogin();"报错解决办法,布布扣,bubuko.com

dl380G8安装windows 2008R2 报错解决办法。

dl380安装windows2008R2时报错,安装包是我一直在用的安装包.我用光盘.优盘还是ILO安装都是报同样的错误.详细错误如下: 1.在复制完系统后重启安装时报下面的错误.我点击确定后系统会重启. windows cannot read the <productkey>setting from the unattend answer file 2.重启后报下面的错误,然后是不停的重启. 原因:是因为HP Intelligent Provisioning版本1.6都存在这个问题. 解决办

java保存报错解决for column &#39;name&#39; at r

Incorrect string value: '\xE6\x98\xAF\xE6\xBB\xB4...' for column 'name' at r 修改数据库的编码 ALTER DATABASE test CHARACTER SET utf8 ALTER TABLE hobby CONVERT TO CHARACTER SET utf8 ALTER TABLE person CONVERT TO CHARACTER SET utf8 java保存报错解决for column 'name'