单master节点k8s集群加入新的master节点报错error execution phase preflight: One or more conditions for hosting...

单master节点k8s集群加入新的master节点报错error execution phase preflight: One or more conditions for hosting…

一、查看节点:

k8s-master01服务器:
查看token和证书:

[root@k8s-master01 iamges-pull]# kubectl get nodes
NAME           STATUS   ROLES                  AGE    VERSION
k8s-master01   Ready    control-plane,master   102m   v1.22.1

二、生成master节点加入命令

[root@k8s-master01 iamges-pull]# kubeadm token create --ttl 0 --print-join-command 
kubeadm join 10.0.0.210:6443 --token b9dfm3.39mwjt0v1oab0xrq --discovery-token-ca-cert-hash sha256:b9a246c680238127e0fdab36d45fff2d2a5a54c48f8fa4c54a235eb9a0012383 
[root@k8s-master01 flannel]# kubeadm init phase upload-certs --upload-certs
I0507 19:50:57.979860   92344 version.go:255] remote version is much newer: v1.24.0; falling back to: stable-1.22
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
6e3e8b8e279385f6f6e89b459686900127eee9a22d061ca3680581a30cd7e703

拼接master节点加入的命令:

kubeadm join 10.0.0.210:6443 --token b9dfm3.39mwjt0v1oab0xrq \
--discovery-token-ca-cert-hash sha256:b9a246c680238127e0fdab36d45fff2d2a5a54c48f8fa4c54a235eb9a0012383 \
--control-plane --certificate-key 9fec8959bb3bb3a14d817f1efb6badc39b81084287ece45294671e4f8ba44445

三、节点加入
k8s-master02服务器:

[root@k8s-master02 iamges-pull]# kubeadm join 10.0.0.210:6443 --token b9dfm3.39mwjt0v1oab0xrq --discovery-token-ca-cert-hash sha256:b9a246c680238127e0fdab36d45fff2d2a5a54c48f8fa4c54a235eb9a0012383 --control-plane --certificate-key 9fec8959bb3bb3a14d817f1efb6badc39b81084287ece45294671e4f8ba44445
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: 
One or more conditions for hosting a new control plane instance is not satisfied.

unable to add a new control plane instance a cluster that doesn't have a stable controlPlaneEndpoint address

Please ensure that:
* The cluster has a stable controlPlaneEndpoint address.
* The certificates that must be shared among control plane instances are provided.


To see the stack trace of this error execute with --v=5 or higher

总是报错,不能加入成功?????????

四、问题解决
k8s-master01服务器:

kubectl -n kube-system edit cm kubeadm-config
## 添加此行信息
controlPlaneEndpoint: "10.0.0.210:6443" 
###保存

如下:

[root@k8s-master01 iamges-pull]# kubectl -n kube-system edit cm kubeadm-config
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
  ClusterConfiguration: |
    apiServer:
      extraArgs:
        authorization-mode: Node,RBAC
      timeoutForControlPlane: 4m0s
    apiVersion: kubeadm.k8s.io/v1beta3
    certificatesDir: /etc/kubernetes/pki
    clusterName: kubernetes
    controllerManager: {}
    dns: {}
    etcd:
      local:
        dataDir: /var/lib/etcd
    imageRepository: 10.0.0.214:80/google_containers
    kind: ClusterConfiguration
    kubernetesVersion: v1.22.1
    controlPlaneEndpoint: "10.0.0.210:6443" ## 添加此行信息
    networking:
      dnsDomain: cluster.local
      podSubnet: 10.244.0.0/16
      serviceSubnet: 10.96.0.0/12
    scheduler: {}
kind: ConfigMap
metadata:
  creationTimestamp: "2022-05-07T10:34:06Z"
  name: kubeadm-config
  namespace: kube-system
  resourceVersion: "8483"
  uid: ae61d9bb-f401-4b79-a47f-f704ced7bc39

k8s-master02服务器:
再次尝试加入:

[root@k8s-master02 iamges-pull]# kubeadm join 10.0.0.210:6443 --token b9dfm3.39mwjt0v1oab0xrq --discovery-token-ca-cert-hash sha256:b9a246c680238127e0fdab36d45fff2d2a5a54c48f8fa4c54a235eb9a0012383 --control-plane --certificate-key 9fec8959bb3bb3a14d817f1efb6badc39b81084287ece45294671e4f8ba44445
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: 
One or more conditions for hosting a new control plane instance is not satisfied.

unable to add a new control plane instance a cluster that doesn't have a stable controlPlaneEndpoint address

Please ensure that:
* The cluster has a stable controlPlaneEndpoint address.
* The certificates that must be shared among control plane instances are provided.


To see the stack trace of this error execute with --v=5 or higher
[root@k8s-master02 iamges-pull]# kubeadm join 10.0.0.210:6443 --token b9dfm3.39mwjt0v1oab0xrq --discovery-token-ca-cert-hash sha256:b9a246c680238127e0fdab36d45fff2d2a5a54c48f8fa4c54a235eb9a0012383 --control-plane --certificate-key 9fec8959bb3bb3a14d817f1efb6badc39b81084287ece45294671e4f8ba44445
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: 
One or more conditions for hosting a new control plane instance is not satisfied.

unable to add a new control plane instance a cluster that doesn't have a stable controlPlaneEndpoint address

Please ensure that:
* The cluster has a stable controlPlaneEndpoint address.
* The certificates that must be shared among control plane instances are provided.


To see the stack trace of this error execute with --v=5 or higher
[root@k8s-master02 iamges-pull]# kubeadm join 10.0.0.210:6443 --token b9dfm3.39mwjt0v1oab0xrq --discovery-token-ca-cert-hash sha256:b9a246c680238127e0fdab36d45fff2d2a5a54c48f8fa4c54a235eb9a0012383 --control-plane --certificate-key 9fec8959bb3bb3a14d817f1efb6badc39b81084287ece45294671e4f8ba44445
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks before initializing the new control plane instance
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[download-certs] Downloading the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [k8s-master02 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.0.0.211 10.0.0.210]
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [k8s-master02 localhost] and IPs [10.0.0.211 127.0.0.1 ::1]
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [k8s-master02 localhost] and IPs [10.0.0.211 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[certs] Using the existing "sa" key
[kubeconfig] Generating kubeconfig files
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[check-etcd] Checking that the etcd cluster is healthy
[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] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
[etcd] Announced new etcd member joining to the existing etcd cluster
[etcd] Creating static Pod manifest for "etcd"
[etcd] Waiting for the new etcd member to join the cluster. This can take up to 40s
The 'update-status' phase is deprecated and will be removed in a future release. Currently it performs no operation
[mark-control-plane] Marking the node k8s-master02 as control-plane by adding the labels: [node-role.kubernetes.io/master(deprecated) node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node k8s-master02 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]

This node has joined the cluster and a new control plane instance was created:

* Certificate signing request was sent to apiserver and approval was received.
* The Kubelet was informed of the new secure connection details.
* Control plane (master) label and taint were applied to the new node.
* The Kubernetes control plane instances scaled up.
* A new etcd member was added to the local/stacked etcd cluster.

To start administering your cluster from this node, you need to run the following as a regular user:

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

Run 'kubectl get nodes' to see this node join the cluster.
[root@k8s-master02 iamges-pull]# mkdir -p $HOME/.kube
[root@k8s-master02 iamges-pull]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@k8s-master02 iamges-pull]# sudo chown $(id -u):$(id -g) $HOME/.kube/config

查看节点:

[root@k8s-master02 iamges-pull]# kubectl get nodes
NAME           STATUS   ROLES                  AGE    VERSION
k8s-master01   Ready    control-plane,master   121m   v1.22.1
k8s-master02   Ready    control-plane,master   11m    v1.22.1

成功!!!!!!!!!!!

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
当在Hive中运行SQL时,如果出现报错"Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask",这通常意味着在执行MapReduce任务时发生了错误。 根据引用和引用,返回代码2表示MapReduce任务执行失败,而返回代码3表示MapReduce Local任务执行失败。这可能是由于以下原因之一导致的错误: 1. 集群环境问题:可能是因为集群配置不正确、资源不足或网络问题导致的。 2. SQL语句问题:可能是由于SQL语句本身存在错误或不完整导致的。 3. 数据问题:可能是由于输入数据格式错误、数据不完整或数据丢失导致的。 要解决这个问题,可以尝试以下几个步骤: 1. 检查集群环境:确保集群的配置正确,资源充足,并检查网络连接是否正常。 2. 检查SQL语句:仔细检查SQL语句是否正确,包括表名、列名、语法等。 3. 检查数据:确保输入数据的格式正确,并且数据完整性良好。 如果以上步骤都没有解决问题,可以尝试以下方法: 1. 检查Hive日志:查看Hive日志文件,了解更详细的错误信息和堆栈跟踪,以帮助进一步分析和解决问题。 2. 寻求专业支持:如果问题仍然存在,可以咨询Hive社区或专业人士,以获取更高级的支持和解决方案。 综上所述,当Hive运行SQL报错"Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask"时,可能是由于集群环境问题、SQL语句问题或数据问题导致的。可以通过检查集群环境、SQL语句和数据来解决问题,并根据Hive日志和专业支持进行进一步的故障排除。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Hive报错FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.mr....](https://blog.csdn.net/qq_41580613/article/details/121242873)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Hive错误之 Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask错误分析_...](https://download.csdn.net/download/weixin_43753599/86508671)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

辛勤汗水@

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值