在运行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 Administer and maintain a swarm of Docker Engines.

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://docs.docker.com/engine/swarm/join-nodes/#join-as-a-worker-node

docker swarm join如何获取token的更多相关文章

  1. docker swarm join 报错

    [peter@minion ~]$ docker swarm join --token SWMTKN-1-3mj5po3c7o04le7quhkdhz6pm9b8ziv3qe0u7hx0hrgxsna ...

  2. Centos7的安装、Docker1.12.3的安装,以及Docker Swarm集群的简单实例

    目录 [TOC] 1.环境准备 ​ 本文中的案例会有四台机器,他们的Host和IP地址如下 c1 -> 10.0.0.31 c2 -> 10.0.0.32 c3 -> 10.0.0. ...

  3. (转) Docker swarm - 使用体验 1+2

    背景 凭借敏捷开发部署理念的推行,相信对于很多人来说docker这项容器技术已经并不陌生,Docker 1.12引擎发布了快两个月,新引擎中包含了许多特性.诸如: Swarm模式,容器集群的健康检查, ...

  4. Docker 三剑客之 Docker Swarm

    上一篇:Docker 三剑客之 Docker Compose 阅读目录: Docker Machine 创建 Docker 主机 Docker Swarm 配置集群节点 Docker Service ...

  5. docker swarm的常用操作

    1. 说明 本文档针对docker swarm操作. 针对的系统是以一个本地的测试系统为例.其中机器信息如下,172.16.1.13作为docker swarm的管理机. 本地测试的机器列表信息: 主 ...

  6. docker swarm 搭建与服务更新

    一,docker swarm 是什么 Docker Swarm.Docker Machine与Docker Compose号称Docker三剑客Docker Swarm 和 Docker Compos ...

  7. 使用Docker Swarm搭建分布式爬虫集群

    https://mp.weixin.qq.com/s?__biz=MzIxMjE5MTE1Nw==&mid=2653195618&idx=2&sn=b7e992da6bd1b2 ...

  8. docker swarm 搭建及跨主机网络互连案例分析

    准备工作 安装docker,不建议直接使用Docker官方的yum install docker wget http://yum.dockerproject.org/repo/main/centos/ ...

  9. docker swarm英文文档学习-11-上锁你的集群来保护你的加密密钥

    Lock your swarm to protect its encryption key上锁你的集群来保护你的加密密钥 在Docker 1.13及更高版本中,默认情况下,群管理器使用的Raft日志在 ...

随机推荐

  1. Are Landing Pages Killing Your Conversion Rate?

    http://searchenginewatch.com/sew/how-to/2411253/are-landing-pages-killing-your-conversion-rate

  2. 【移动开发】Android中WIFI开发总结(二)

    搞了好几天终于有点眉目了,这里接着总结一下Android中WiFi的使用,在前面(http://smallwoniu.blog.51cto.com/3911954/1334951)我们已经简单了解了W ...

  3. (二)Knockout - ViewModel 的使用

    计算属性 实际应用中,我们通常需要对数据进行加工 如: 指定日期格式,将数字相加... 等,此时可使用ko.computed().当数据发生改变是,KO会使用computed重新计算 DEMO1 更改 ...

  4. Linux学习之scp命令

    scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的,可能会稍微影响一下速度.当你服务器 ...

  5. 数论F - Strange Way to Express Integers(不互素的的中国剩余定理)

    F - Strange Way to Express Integers Time Limit:1000MS     Memory Limit:131072KB     64bit IO Format: ...

  6. 小梦windows phone 8.1开发:语音朗读

    使用SpeechSynthesizer类可以实现文本朗读功能,位于 Windows.Media.SpeechSynthesis命名空间.有了它我们就可以实现有声小说了,是不是很爽.下面给出一个将文本块 ...

  7. ACM-ICPC 2018 南京赛区网络预赛 J题Sum(线性筛素数)

    题目链接:https://nanti.jisuanke.com/t/30999 参考自博客:https://kuangbin.github.io/2018/09/01/2018-ACM-ICPC-Na ...

  8. day14 Python函数

    函数def,严格来讲有个return返回值 过程就是没有return返回值的函数 #过程 def test01(): msg = 'liuhaoran' print(msg) #函数 def test ...

  9. 【Codeforces 526D】Om Nom and Necklace

    Codeforces 526 D 题意:给一个字符串,求每个前缀是否能表示成\(A+B+A+B+\dots+A\)(\(k\)个\(A+B\))的形式. 思路1:求出所有前缀的哈希值,以便求每个子串的 ...

  10. JDBC的简单封装

    import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import ...