在stop docker leader node后,如何发现当前谁是manager node?
我当前集群环境如下:
~ $ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
czn1ts6u2o24pcyeojlsr9ai7 node4 Ready Active
lrlhx7smzo9rafckep5b05fgw node3 Ready Active
s38rdi1wlxqbvtfl1sa3ne17r * node1 Ready Active Leader
uubznl6kas1mpd5evpqamtr9x node5 Ready Active
z4otpoy5a8m8px2e3bh9jy5jd node2 Ready Active
然后我promote node2 , node3
~ $ docker node promote node2 node3
Node node2 promoted to a manager in the swarm.
Node node3 promoted to a manager in the swarm.
再次查看当前的node情况
~ $ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
czn1ts6u2o24pcyeojlsr9ai7 node4 Ready Active
lrlhx7smzo9rafckep5b05fgw node3 Ready Active Reachable
s38rdi1wlxqbvtfl1sa3ne17r * node1 Ready Active Leader
uubznl6kas1mpd5evpqamtr9x node5 Ready Active
z4otpoy5a8m8px2e3bh9jy5jd node2 Ready Active Reachable
然后我开始STOP leader node (manager)
~ $ docker-machine stop node1
Stopping "node1"...
Machine "node1" was stopped.
再次执行下面的命令
~ $ docker node ls
error during connect: Get https://192.168.99.100:2376/v1.30/nodes: dial tcp 192.168.99.100:2376: getsockopt: no route to host
那么问题来了,我此时如何知道谁是 leader node?, 因为我只有知道leader node,才开始进行
eval $(docker-machine env 'leader node name')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了