创建两个虚拟机
1 | $ docker-machine create --driver virtualbox myvm1 |
登陆虚拟机,并以root权限修改配置
1 | $ docker-machine ssh myvm1 |
创建Swarm集群
1 | $ docker-machine ssh myvm1 "docker swarm init --advertise-addr 192.168.99.100:2377" |
创建
1 | $ vi getstartedlab.yml |
查看
1 | $ docker-machine ssh myvm1 "docker stack ps getstartedlab" |
服务访问
滚动升级
1 | docker service update --image redis:3.0.7 redis |
封锁节点
1 | docker node update --availability drain <NODE-ID> |
概念
stack > service > task
1 | docker stack ls # List all running applications on this Docker host |