服务器设计
一个管理服务器,两个节点服务器
docker-machine create --driver virtualbox swarmMng
docker-machine create --driver virtualbox swarmNd1
docker-machine create --driver virtualbox swarmNd2
[root@localhost ~]# docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v19.03.5
swarmMng - virtualbox Running tcp://192.168.99.102:2376 v19.03.5
swarmNd1 - virtualbox Running tcp://192.168.99.103:2376 v19.03.5
swarmNd2 - virtualbox Running tcp://192.168.99.104:2376 v19.03.5
配置swarm集群信息
docker-machine ssh swarmMng “docker swarm init --advertise-addr 192.168.99.102”
[root@localhost ~]# docker-machine ssh swarmMng "docker swarm init --advertise-addr 192.168.99.102"
Swarm i