Docker 创建swarm集群

2019-01-18  本文已影响0人  凉风有信llm

主节点执行

docker swarm init --advertise-addr 10.0.0.10
Swarm initialized: current node (xpew91a0kcdv91im5bao4mt21) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-4714fztw2qew7dz79amxg64e34m4za1ubwtq7rfmp325by8x45-9lp25c7whcmwsoto1jwbmcnwp 10.0.0.10:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

docker swarm join-token manager
To add a manager to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-4714fztw2qew7dz79amxg64e34m4za1ubwtq7rfmp325by8x45-0jfgedcgxt8ib3cefdd3ob2bz 10.0.0.10:2377

从节点执行

docker swarm join --token SWMTKN-1-4714fztw2qew7dz79amxg64e34m4za1ubwtq7rfmp325by8x45-0jfgedcgxt8ib3cefdd3ob2bz 10.0.0.10:2377

如果忘记了命令可以在主节点执行

[root@liming ~/coredns 11:53:32]# docker swarm join-token worker
To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-4714fztw2qew7dz79amxg64e34m4za1ubwtq7rfmp325by8x45-9lp25c7whcmwsoto1jwbmcnwp 10.0.0.10:2377
上一篇下一篇

猜你喜欢

热点阅读