在运行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. 【 D3.js 入门系列 --- 9 】 常见可视化图形

    本人的个人博客为: www.ourd3js.com csdn博客为: blog.csdn.net/lzhlzz 转载请注明出处,谢谢. Layout ,直译为"布局,安排".但在 ...

  2. 汽车之家店铺数据抓取 DotnetSpider实战

    一.背景 春节也不能闲着,一直想学一下爬虫怎么玩,网上搜了一大堆,大多都是Python的,大家也比较活跃,文章也比较多,找了一圈,发现园子里面有个大神开发了一个DotNetSpider的开源库,很值得 ...

  3. Revit API射线法读取空间中相交的元素

    Revit API提供根据射线来寻找经过的元素.方法是固定模式,没什么好说.关键代码:doc.FindReferencesWithContextByDirection(ptStart, (ptEnd  ...

  4. ansible经常使用模块使用方法

    ansible 默认提供了非常多模块来供我们使用. 在 Linux 中,我们能够通过 ansible-doc -l 命令查看到当前 ansible 都支持哪些模块,通过 ansible-doc  -s ...

  5. 在ASP.NET MVC中使用Knockout实践09,自定义绑定

    Knockout真正强大之处在于绑定机制,通过data-bind属性值体现绑定,不仅可以绑定值,还可以绑定事件,甚至可以自定义绑定. 从一个例子看Knockou的绑定机制 假设想给一个button元素 ...

  6. Navicat Premium 12.1.7.0安装与激活

    原文:https://www.jianshu.com/p/5f693b4c9468 Navicat Premium 12.1.8.0安装与激活 丿记忆灬永殇丨 关注 2018.01.20 13:43* ...

  7. Android App组件之Fragment说明和示例

    Android App组件之Fragment说明和示例 1 Fragement介绍 Android从3.0开始引入Fragment,主要是为了支持更动态更灵活的界面设计. Fragment是activ ...

  8. 咏南中间件开始支持redis client接口调用

    咏南中间件开始支持redis client接口调用 咏南中间件封装了redis client接口,可以支持REDIS了. 如下图,将数据集写入REDIS缓存,和从REDIS缓存获取数据: proced ...

  9. idhttpserver的使用方法

    idhttpserver的使用方法 1)CommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo ...

  10. Android上的单元测试

    Android上的单元测试 http://www.sina.com.cn  2009年12月04日 16:07  IT168.com [IT168 技术文档]任何程序的开发都离不开单元测试来保证其健壮 ...