1配置环境
systemctl set-hostname master01
systemctl set-hostname master02
systemctl set-hostname node01
systemctl set-hostname node02
vi /etc/hosts
192.168.198.154 master01
192.168.198.155 master02
192.168.198.156 node01
192.168.198.157 node02
scp /etc/hosts root@master02:/etc/hosts
scp /etc/hosts root@node01:/etc/hosts
scp /etc/hosts root@node02:/etc/hosts
关闭swap
swapoff -a
vi /etc/fstab
关闭防火墙
iptables -F
systemctl stop firewalld && systemctl disable firewalld
关闭selinux
sed -i 's/enforcing/disabled/g' /etc/selinux/config; setenforce 0
2安装docker
curl http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker.repo
yum makecache fast
yum install -y docker-ce
配置镜像加速:
cat > /etc/docker/daemon.json <<EOF
{
"registry-mirrors": ["https://jzbtfwo9.mirror.aliyuncs.com"]
}
EOF
启动docker
systemctl start docker && systemctl enable docker
3安装rancher
docker run -d --restart=unless-stopped -p 8080:80 -p 8443:443 rancher/rancher:v2.3.1
4图形界面操作
来源:CSDN
作者:hxpjava1
链接:https://blog.csdn.net/hxpjava1/article/details/103573709