sudo docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
kj7q08sfk4ojxq9cq9ezejk78 ip-172-31-0-113 Ready Active 19.03.12
64z9yjpcsg3wu0yivbxfjkasd ip-172-31-8-58 Ready Active 19.03.12
o4adqybqntezkuluy709304os * ip-172-31-15-10 Ready Active Leader 19.03.12
sudo docker service create --replicas 3 --name redis --update-delay 10s redis:3.0.6
oweb3lurs5hpm9ah9j2em0o8l
overall progress: 3 out of 3 tasks
1/3: running [==================================================>]
2/3: running [==================================================>]
3/3: running [==================================================>]
verify: Service converged
sudo docker service ps redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
ua4481gmwvpv redis.1 redis:3.0.6 ip-172-31-0-113 Running Running 7 seconds ago
a0tvd443ecqe redis.2 redis:3.0.6 ip-172-31-8-58 Running Running 7 seconds ago
w6rxo94045nu redis.3 redis:3.0.6 ip-172-31-15-10 Running Running 7 seconds ago
# sudo docker node update --availability drain hostname_node
sudo docker node update --availability drain ip-172-31-0-113
ip-172-31-0-113
sudo docker node inspect --pretty ip-172-31-0-113 | grep Availability
Availability: Drain
sudo docker service ps redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
0lzokely26wt redis.1 redis:3.0.6 ip-172-31-8-58 Running Running 2 minutes ago
ua4481gmwvpv \_ redis.1 redis:3.0.6 ip-172-31-0-113 Shutdown Shutdown 2 minutes ago
a0tvd443ecqe redis.2 redis:3.0.6 ip-172-31-8-58 Running Running 3 minutes ago
w6rxo94045nu redis.3 redis:3.0.6 ip-172-31-15-10 Running Running 3 minutes ago
sudo docker node update --availability active ip-172-31-0-113
ip-172-31-0-113
sudo docker node inspect --pretty ip-172-31-0-113 | grep Availability
Availability: Active
sudo docker service rm redis
redis
No comments:
Post a Comment