#升级系统内核为 4.44# CentOS 7.x 系统自带的 3.10.x 内核存在一些 Bugs,导致运行的 Docker、Kubernetes 不稳定,查看内核命令uname -r,升级步骤如下:rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm#安装完成后检查 /boot/grub2/grub.cfg 中对应内核 menuentry 中是否包含 initrd16 配置,如果没有,再安装一次!yum --enablerepo=elrepo-kernel install -y kernel-lt #设置开机从新内核启动grub2-set-default "CentOS Linux (4.4.182-1.el7.elrepo.x86_64) 7 (Core)" #重启reboot # 查看内核变化啦#安装dockerwget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repoyum -y install docker-ce #镜像加速vim /etc/docker/daemon.json{ "data-root": "/data/docker", "storage-driver": "overlay2", "insecure-registries": ["registry.access.redhat.com","quay.io"], "registry-mirrors": ["https://k5oy7o4o.mirror.aliyuncs.com"], "bid": "172.168.10.0/24", "exec-opts": ["native.cgroupdriver=systemd"], "live-restore": true}#或者vim /etc/systemd/system/multi-user.target.wants/docker.serviceExecStart=/usr/bin/dockerd --graph=/data/docker --storage-driver=overlay2 --registry-mirrors=https://k5oy7o4o.mirror.aliyuncs.com --insecure-registries=registry.access.redhat.com --insecure-registries=quay.io --bid=172.168.10.0/24 --exec-opts=native.cgroupdriver=systemd --live-restore=true #启动systemctl enable docker && systemctl start docker#测试docker infodocker run hello-world# 运行流程To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.