
[ERROR CRI]: container runtime is not running: output: E1119 18:10:02.242756 3025 remote_runtime.
输入kubernetes初始化命令,然后出现下面的报错。
·
一、报错日志
输入kubernetes初始化命令,然后出现下面的报错。
kubeadm init --kubernetes-version=v1.28.15 --pod-network-cidr=172.16.0.0/16 --apiserver-advertise-address=192.168.254.129
二、报错分析
分析报错:缺少containerd软件,并且还需要修改下containerd软件的配置文件。
[init] Using Kubernetes version: v1.28.15
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: E1119 18:10:02.242756 3025 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="2024-11-19T18:10:02+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
[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
三、解决方案
1、获取阿里云YUM源,然后查看YUM源中Containerd软件。
wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list | grep containerd
2、安装Containerd.io软件,即可安装Containerd。
yum -y install containerd.io
3、使用rpm -qa | grep containerd
命令查看是否安装。
4、设置containerd服务启动及开机自启动。
systemctl enable containerd
systemctl start containerd
5、查看containerd服务启动状态。
systemctl status containerd
6、安装Containerd时ctr命令亦可使用,ctr命令主要用于管理容器及容器镜像等。使用ctr version
命令查看Containerd客户端及服务端相关信息。
7、修改配置文件:vim /etc/containerd/config.toml
,将原先的disabled_plugins = [“cri”]复制粘贴后注释掉,然后删除中括号内的"cri",保存并退出。
8、systemctl restart containerd
重新启动containerd。
我强烈推荐4本可以改变命运的经典著作:
更多推荐
所有评论(0)