博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
docker swarm join如何获取token
阅读量:6540 次
发布时间:2019-06-24

本文共 2419 字,大约阅读时间需要 8 分钟。

在运行docker swarm join的时候需要一个token参数,如何知道这个参数那?

【答案】

Join as a worker node

To retrieve the join command including the join token for worker nodes, run the following command on a manager node:

$ 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

Run the command from the output on the worker to join the swarm:

$ docker swarm join \

--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \

192.168.99.100:2377

 

This node joined a swarm as a worker.

The docker swarm join command does the following:

  • switches the Docker Engine on the current node into swarm mode.
  • requests a TLS certificate from the manager.
  • names the node with the machine hostname
  • joins the current node to the swarm at the manager listen address based upon the swarm token.
  • sets the current node to Active availability, meaning it can receive tasks from the scheduler.
  • extends the ingress overlay network to the current node.

Join as a manager node

When you run docker swarm join and pass the manager token, the Docker Engine switches into swarm mode the same as for workers. Manager nodes also participate in the raft consensus. The new nodes should be Reachable, but the existing manager will remain the swarm Leader.

Docker recommends three or five manager nodes per cluster to implement high availability. Because swarm mode manager nodes share data using Raft, there must be an odd number of managers. The swarm can continue to function after as long as a quorum of more than half of the manager nodes are available.

For more detail about swarm managers and administering a swarm, see .

To retrieve the join command including the join token for manager nodes, run the following command on a manager node:

$ docker swarm join-token manager

 

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

 

docker swarm join \

--token SWMTKN-1-61ztec5kyafptydic6jfc1i33t37flcl4nuipzcusor96k7kby-5vy9t8u35tuqm7vh67lrz9xp6 \

192.168.99.100:2377

Run the command from the output on the manager to join the swarm:

$ docker swarm join \

--token SWMTKN-1-61ztec5kyafptydic6jfc1i33t37flcl4nuipzcusor96k7kby-5vy9t8u35tuqm7vh67lrz9xp6 \

192.168.99.100:2377

 

This node joined a swarm as a manager.

 

来自:

转载于:https://www.cnblogs.com/time-is-life/p/7562565.html

你可能感兴趣的文章
solr第一天 基础增删改查操作
查看>>
day30 item系列
查看>>
day11 reduce函数
查看>>
android 获取屏幕大小
查看>>
Linq之Linq to Sql
查看>>
洛谷 1018 乘积最大
查看>>
计算并发用户数的五种方法
查看>>
项目管理理论与实践(7)——软件开发报价的计算方法
查看>>
【leetcode】20. Valid Parentheses
查看>>
数据库事务总结
查看>>
LeetCode 157,158. Read N Characters Given Read4 I+II
查看>>
Canvas
查看>>
linux软件包管理
查看>>
[20180817]校内模拟赛
查看>>
项目心得1
查看>>
you do not have permission
查看>>
转-项目管理5阶段|一位高级项目经理的4年项目经验分享
查看>>
python print 方法 打印 unicode 遇到的坑
查看>>
2014.12 零碎知识点
查看>>
内核怎样管理你的内存【转】
查看>>