- The DevOps 2.1 Toolkit:Docker Swarm
- Viktor Farcic
- 164字
- 2021-07-09 21:03:38
Failover
Fortunately, failover strategies are part of Docker Swarm. Remember, when we execute a service command, we are not telling Swarm what to do but the state we desire. In turn, Swarm will do its best to maintain the specified state no matter what happens.
To test a failure scenario, we'll destroy one of the nodes:
docker-machine rm -f node-3
Swarm needs a bit of time until it detects that the node is down. Once it does, it will reschedule containers. We can monitor the situation through service ps command:
docker service ps go-demo
The output (after rescheduling) is as follows (ID is removed for brevity):

As you can see, after a short period, Swarm rescheduled containers among healthy nodes (node-1 and node-2) and changed the state of those that were running on the failed node to Shutdown. If your output still shows that some instances are running on the node-3, please wait for a few moments and repeat the service ps command.
- Internet接入·網(wǎng)絡(luò)安全
- 傳感器技術(shù)應(yīng)用
- 21天學(xué)通ASP.NET
- 21天學(xué)通Visual Basic
- 網(wǎng)絡(luò)布線與小型局域網(wǎng)搭建
- Linux嵌入式系統(tǒng)開發(fā)
- INSTANT Puppet 3 Starter
- 智慧未來
- 手把手教你學(xué)Flash CS3
- 自適應(yīng)學(xué)習(xí):人工智能時代的教育革命
- PostgreSQL 10 High Performance
- 大型機系統(tǒng)應(yīng)用基礎(chǔ)
- PowerPoint 2003中文演示文稿5日通
- 當(dāng)產(chǎn)品經(jīng)理遇到人工智能
- 多傳感器數(shù)據(jù)智能融合理論與應(yīng)用