本次在虚拟机中执行操作
首先第一步:
准备好三台节点,设置好静态ip地址,记住三台ip地址,我这边演示的ip地址分别为:
192.168.125.101 master
192.168.125.102 node1
192.168.125.103 node2
其中三台名字命名方式为:
hostnamectl set-hostname master #此命令在master节点中执行,两台node机器同理
接下来正式进行docker安装操作,三台机器同时操作,不要只执行一个节点机器
1:关闭防火墙:
$ systemctl stop firewalld
$ systemctl disable firewalld
2:关闭 selinux:
$ sed -i 's/enforcing/disabled/' /etc/selinux/config # 永久
$ setenforce 0 # 临时
3: 关闭 swap:
$ swapoff -a # 临时
$ vim /etc/fstab # 永久
4: 添加 hosts:
$ cat >> /etc/hosts <