2016-12-29 100 views
0

我公司目前拥有分布在4个不同的主机上8个容器在我的泊坞窗的设置。如何重新启动多个集装箱码头工人群

[email protected]:~$ docker service ls 
ID   NAME   MODE REPLICAS IMAGE 
yyyytxxxxx8 mycontainers global 8/8  myapplications:latest 

运行在服务ps -a得到以下。

[email protected]:~$ docker service ps -a yy 
NAME       IMAGE      NODE   DESIRED STATE CURRENT STATE  ERROR PORTS 
mycontainers1    myapplications:latest: ip-192-168-1-5 Running  Running 3 hours ago 
\_ mycontainers2    myapplications:latest: ip-192-168-1-6 Running  Running 3 hours ago 
\_ mycontainers3    myapplications:latest: ip-192-168-1-7 Running  Running 3 hours ago 
\_ mycontainers4    myapplications:latest: ip-192-168-1-8 Running  Running 3 hours ago 
\_ mycontainers1    myapplications:latest: ip-192-168-1-5 Running  Running 3 hours ago 
\_ mycontainers2    myapplications:latest: ip-192-168-1-6 Running  Running 3 hours ago 
\_ mycontainers3    myapplications:latest: ip-192-168-1-7 Running  Running 3 hours ago 
\_ mycontainers4    myapplications:latest: ip-192-168-1-8 Running  Running 3 hours ago 

我的问题是如何执行使用服务ID的所有容器的重新启动?我不想手动登录到每个节点并执行重新启动。

回答

0

更新现有服务,群将重新创建所有容器。例如,您可以简单地更新服务的属性以存档重新启动。

2

在泊坞窗1.12.x的最新的稳定版本,可以通过更新服务配置重新启动容器,但在泊坞窗1.13.0这是即将发布,即使该服务设置没有改变,由指定--force标志,容器将被重新启动。如果你不介意使用1.13.0 RC4,你可以现在就做。

$ docker service update --force mycontainers 

更新:多克1.13.0已经发布。

https://github.com/docker/docker/releases/tag/v1.13.0

相关问题