[root@his ~]# kubeadm init --pod-network-cidr=192.168.0.0/16 --kubernetes-version=v1.25.0 --apiserver-advertise-address=192.168.8.109 [init] Using Kubernetes version: v1.25.0 [preflight] Running pre-flight checks [WARNING Hostname]: hostname "his" could not be reached [WARNING Hostname]: hostname "his": lookup his on 192.168.8.254:53: no such host error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR CRI]: container runtime is not running: output: E0714 18:14:51.757340 11481 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/containerd/containerd.sock: connect: no such file or directory\"" time="2023-07-14T18:14:51+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/containerd/containerd.sock: connect: no such file or directory\"" , error: exit status 1 [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1 [ERROR KubeletVersion]: the kubelet version is higher than the control plane version. This is not a supported version skew and may lead to a malfunctional cluster. Kubelet version: "1.27.3" Control plane version: "1.25.0" [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher
时间: 2024-04-15 22:31:52 浏览: 294
H3CSE-RS-372.pdf
根据您提供的命令输出,您在执行`kubeadm init`命令时遇到了一些错误。让我们逐个来解决这些问题:
1. [WARNING Hostname]: hostname "his" could not be reached
[WARNING Hostname]: hostname "his": lookup his on 192.168.8.254:53: no such host
这个警告意味着您的主机名无法解析。您可以通过编辑`/etc/hosts`文件来解决此问题,并将`his`主机名映射到正确的IP地址。示例如下:
```shell
sudo nano /etc/hosts
```
在文件中添加以下行:
```
192.168.8.109 his
```
保存并关闭文件。
2. [ERROR CRI]: container runtime is not running: output: E0714 18:14:51.757340 11481 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/containerd/containerd.sock: connect: no such file or directory\""
此错误指示容器运行时未运行。这可能是由于您的容器运行时(例如containerd)未正确安装或配置导致的。请确保您已按照正确的步骤安装和配置了容器运行时。您可以尝试重新安装或重新配置容器运行时来解决此问题。
3. [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
这个错误表示`/proc/sys/net/bridge/bridge-nf-call-iptables`文件的内容不是1。您可以通过运行以下命令来解决此问题:
```shell
echo 1 | sudo tee /proc/sys/net/bridge/bridge-nf-call-iptables
```
4. [ERROR KubeletVersion]: the kubelet version is higher than the control plane version. This is not a supported version skew and may lead to a malfunctional cluster. Kubelet version: "1.27.3" Control plane version: "1.25.0"
这个错误表示您的kubelet版本高于控制平面版本。这不是受支持的版本差异,并且可能导致集群功能异常。为了解决此问题,您需要确保kubelet和控制平面使用相同的Kubernetes版本。您可以尝试升级或降级kubelet版本,以与控制平面版本匹配。
请根据上述解决方案逐个解决问题,并尝试重新执行`kubeadm init`命令。如果问题仍然存在,请提供更多详细信息,以便我们能够更好地帮助您解决问题。
阅读全文