Docker Swarm 服务版本更新
环境:
- 系统:Centos 7.4 x64
- 应用版本:Docker 18.09.0
- 管理节点:192.168.1.79
- 工作节点:192.168.1.78
- 工作节点:192.168.1.77
1、管理节点:创建服务设置更新策略
docker service create \ --replicas 3 \ --name redis \ --update-delay 10s \ --update-parallelism 2 \ --update-failure-action continue \ redis:3.0.6
# 创建命令 docker service create \ # 副本数 --replicas 3 \ # 服务名 --name redis \ # 设定容器间更新时间间隔 --update-delay 10s \ # 更新时同时并行更新数量,默认1 --update-parallelism 2 \ # 任务容器更新失败时的模式 continue为继续使用 --update-failure-action continue \ # 镜像 redis:3.0.6