ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
**1. 配置 Docker yum 源【所有节点】** ```shell (1)安装必要的一些系统工具 # yum install -y yum-utils device-mapper-persistent-data lvm2 (2)添加软件源信息 # yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo (3) # sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo (4)更新 # yum makecache fast ``` **** 参考文档:[https://developer.aliyun.com/mirror/docker-ce/?spm=a2c6h.25603864.0.0.6bff25b4m18JkV](https://developer.aliyun.com/mirror/docker-ce/?spm=a2c6h.25603864.0.0.6bff25b4m18JkV) <br/> **2. 安装 Docker 与 containerd【所有节点】** >[info]自 k8s 1.24.0+,k8s 开始使用 containerd 替代 Docker 作为容器运行时,所以 Docker 不是必须的,但还是推荐安装 Docker,因为在 k8s 中构建 Docker 镜像时可能会用到。<br/> 安装 Docker 就自动安装 containerd 了。 ```shell (1)移除已经安装的docker # yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine (2)安装docker # yum install -y docker-ce docker-ce-cli docker-compose-plugin (3)查看 docker 版本 # docker --version (4)查看 containerd 版本 # containerd --version containerd containerd.io 1.6.18 (5)docker 开机自启 # systemctl enable docker (6)启动 docker # systemctl start docker (7)查看 docker 状态 # systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running)【running表示已经启动成功】 (8)查看 containerd 状态 # systemctl status containerd ● containerd.service - containerd container runtime Loaded: loaded (/usr/lib/systemd/system/containerd.service; disabled; vendor preset: disabled) Active: active (running)【running表示已经启动成功】 ``` >[info]启动 docker 也自动启动了 containerd <br/> **3. 编辑 containerd 配置【所有节点】** ```shell (1)将 containerd 的配置文件做个备份 # cp /etc/containerd/config.toml /etc/containerd/config.toml.bak (2)导出 containerd 的默认配置到 /etc/containerd/config.toml # containerd config default > /etc/containerd/config.toml (3)sandbox_image 镜像源设置为阿里云 google_containers 镜像源 # sed -i "s#registry.k8s.io/pause#registry.cn-hangzhou.aliyuncs.com/google_containers/pause#g" /etc/containerd/config.toml (4)查看配置文件中的 disabled_plugins 是否存在 cri # more /etc/containerd/config.toml disabled_plugins = ["cri"] (5)如果配置文件存在 cri,运行该命令移除 cri sed -i "s#SystemdCgroup = false#SystemdCgroup = true#g" /etc/containerd/config.toml (6)重启 containerd # systemctl restart containerd ``` <br/> **4. 配置 docker 镜像源【所有节点】** ```shell (1)配置 Docker 镜像源 # cat >> /etc/docker/daemon.json<<EOF { "registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"] } EOF (2)重启 Docker # systemctl restart docker (3)查看 docker 状态 # systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running)【running表示启动成功】 (4)查看 containerd 状态 # systemctl status containerd ● containerd.service - containerd container runtime Loaded: loaded (/usr/lib/systemd/system/containerd.service; disabled; vendor preset: disabled) Active: active (running)【running表示启动成功】 ```