add nodes to the swarm
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了add nodes to the swarm相关的知识,希望对你有一定的参考价值。
一旦你们创建了一个带有管理节点的swarm集群,你就可以开始添加 worker节点
$ docker-machine ssh worker1 $ docker swarm join --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c 192.168.99.100:2377 This node joined a swarm as a worker.
你可以在管理节点通过下面命令来获取token
$ docker swarm join-token worker To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c 192.168.99.100:2377
把worker2 节点也加入进来
$ docker-machine ssh worker2 $ docker swarm join --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c 192.168.99.100:2377 This node joined a swarm as a worker.
查看所有节点的信息:(只能在管理节点执行)
$docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 03g1y59jwfg7cf99w4lt0f662 worker2 Ready Active 9j68exjopxe7wfl6yuxml7a7j worker1 Ready Active dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader
manager列留空的是 worker节点
Leader 表示该节点为 manager节点
docker node ls 命令只能在 manager节点才能运行
本文出自 “清风柳絮” 博客,请务必保留此出处http://binuu.blog.51cto.com/801317/1942314
以上是关于add nodes to the swarm的主要内容,如果未能解决你的问题,请参考以下文章
05_deploy a sevice to the swarm
denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock.......(代码片
denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock.......(代码片
flink1.11报错:java.lang.IllegalStateException: No ExecutorFactory found to execute the application(代码片