环境部署:
三台rhel7.3主机
server11:172.25.51.11
server12:172.25.51.12
server13:172.25.51.13
注意:关闭 docker-compose
[root@foundation51 ~]# cd /tmp/docker/compose/
[root@foundation51 compose]# docker-compose stop
具体部署:
1、三个节点安装Docker并开启服务
docker-engine.x86_64 0:17.03.1.ce-1.el7.centos
docker-engine-selinux.noarch 0:17.03.1.ce-1.el7.centos
[root@server12 ~]# systemctl start docker
2、初始化集群(swarm)
[root@server11 ~]# docker swarm init
3、节点加入集群
[root@server12 ~]# docker swarm j