关闭swap分区
vi /etc/fstab
注释掉
/dev/mapper/centos-swap swap swap default 0 0
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
设置主机名称
hostnamectl set-hostname k8s-master
hostnamectl set-hostname k8s-node01
加入dns解析
echo '192.168.58.134 k8s-master
192.168.58.135 k8s-node01' >> /etc/hosts
安装docker
# 1.先安装yml
yum install -y yum-utils device-mapper-persistent-data lvm2
# 2.设置阿里云镜像
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 3.查看可安装的docker版本
yum list docker-ce --showduplicates | sort -r
#4. 安装docker
yum install docker-ce-19.03.9-3.el7 docker-ce-cli-19.03