zoukankan      html  css  js  c++  java
  • k8s节点删除后重新加入异常处理

    删除节点重新加入报错:

    error execution phase check-etcd: etcd cluster is not healthy: failed to dial endpoint https://192.168.123.21:2379 with maintenance client: context deadline exceeded

    error execution phase check-etcd: error syncing endpoints with etc: dial tcp 172.31.182.152:2379: connect: connection refused
     解决方法:
    1.在kubeadm-config删除的状态不存在的etcd节点:
    kubectl edit configmaps -n kube-system kubeadm-config
    cn-hongkong.i-j6caps6av1mtyxyofmrw:
    advertiseAddress: 172.31.182.152
    bindPort: 6443
    把上边的删掉:

    2.因为我是用kubeadm搭建的集群,所有etcd在每个master节点都会以pod的形式存在一个,etcd是在每个控制平面都启动一个实例的,当删除k8s-001节点时,etcd集群未自动删除此节点上的etcd成员,因此需要手动删除。
    注意这里首先要进入etcd的pod。
    kubectl exec -it etcd-cn-hongkong.i-j6caps6av1mtyxyofmrx sh -n kube-system
    export ETCDCTL_API=3
    alias etcdctl='etcdctl --endpoints=https://172.31.182.153:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key'
    / # etcdctl member list
    ceb6b1f4369e9ecc, started, cn-hongkong.i-j6caps6av1mtyxyofmrx, https://172.31.182.154:2380, https://172.31.182.154:2379
    d4322ce19cc3f8da, started, cn-hongkong.i-j6caps6av1mtyxyofmrw, https://172.31.182.152:2380, https://172.31.182.152:2379
    d598f7eabefcc101, started, cn-hongkong.i-j6caps6av1mtyxyofmry, https://172.31.182.153:2380, https://172.31.182.153:2379
    #删除不存在的节点
    / # etcdctl member remove d4322ce19cc3f8da
    Member d4322ce19cc3f8da removed from cluster ed812b9f85d5bcd7
    / # etcdctl member list
    ceb6b1f4369e9ecc, started, cn-hongkong.i-j6caps6av1mtyxyofmrx, https://172.31.182.154:2380, https://172.31.182.154:2379
    d598f7eabefcc101, started, cn-hongkong.i-j6caps6av1mtyxyofmry, https://172.31.182.153:2380, https://172.31.182.153:2379
    / # etcdctl member list
    cd4e1e075b1904b2, started, cn-hongkong.i-j6caps6av1mtyxyofmrw, https://172.31.182.152:2380, https://172.31.182.152:2379
    ceb6b1f4369e9ecc, started, cn-hongkong.i-j6caps6av1mtyxyofmrx, https://172.31.182.154:2380, https://172.31.182.154:2379
    d598f7eabefcc101, started, cn-hongkong.i-j6caps6av1mtyxyofmry, https://172.31.182.153:2380, https://172.31.182.153:2379
    / # exit

      最后每次kubeadm join失败后要kubeadm reset重置节点,在kubeadm join才会成功。

  • 相关阅读:
    magento设置快捷支付后,付款出现Unable to communicate with the PayPal gateway
    Magento安装插件失败出现503错误的解决方法
    magento安装插件后显示404error
    magento安装插件报connection string is empty
    mysql修改root密码
    thinkphp 3.2.3版本学习笔记
    那些年,被我蠢哭了的php代码小错误~~~
    PHP实现文件上传和下载(单文件上传、多文件上传、多个单文件上传)(面向对象、面向过程)
    php生成纯数字、字母数字、图片、纯汉字的随机数验证码
    php使用GD库实现图片水印和缩略图——封装成类
  • 原文地址:https://www.cnblogs.com/lidezhen/p/13472400.html
Copyright © 2011-2022 走看看