在运行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. spring-boot 速成(9) druid+mybatis 多数据源及读写分离的处理

    按上节继续学习,稍微复杂的业务系统,一般会将数据库按业务拆开,比如产品系统的数据库放在product db中,订单系统的数据库放在order db中...,然后,如果量大了,可能每个库还要考虑做读.写 ...

  2. JTAG – A technical overview and Timing

    This document provides you with interesting background information about the technology that underpi ...

  3. STM32F4 Alternate function mapping

    #define GPIO_AF0_MCO // MCO (MCO1 and MCO2) Alternate Function mapping #define GPIO_AF0_RTC_50Hz // ...

  4. Swift iOS 文件操作:沙盒(SandBox)、程序包(NSBundle)

    1.沙盒机制介绍 iOS 中的沙盒机制(SandBox)是一种安全体系.每个 iOS 应用程序都有一个单独的文件系统(存储空间),而且只能在对应的文件系统中进行操作,此区域被称为沙盒.所有的非代码文件 ...

  5. 在Delphi中操作快捷方式

    快捷方式减少了系统的重复文件,是快速启动程序或打开文件或文件夹的方法,快捷方式对经常使用的程序.文件和文件夹非常有用.在Windows系统中,充斥着大量的快捷方式,那么如何操作这些快捷方式就是一个很头 ...

  6. .NET:不要使用扩展方法扩展Object对象。

    C#的扩展方法算是一种Minin(掺入)机制,掺入方法有其合理的使用场景,这里说说一种不好的使用场景(个人意见):不要使用扩展方法扩展Object对象.扩展Object会对所有类型的示例有侵入,特别是 ...

  7. java去除数组中重复的元素方法总结

    /* * ArrayUnique.java * Version 1.0.0 * Created on 2017年12月16日 * Copyright ReYo.Cn */ package reyo.s ...

  8. 盾牌第一至七季/全集The Shield迅雷下载

    英文译名The Shield,第1-7季(2002-2008)FX.本季看点:<盾牌>一部极具争议性的连续剧,打破了传统警匪片套路,刻画了性格复杂的警察,他们在与各种罪案做斗争的同时,也面 ...

  9. 在MFC内竟然不可以解析“Mat”

    调试了好久,在MFC内竟然不可以解析“Mat” 总是显示"Mat"没有定义,改动include.lib.依赖库, 不断地改动: #include "opencv2/img ...

  10. 制作高仿QQ的聊天系统(下)—— Adapter & Activity

    一.适配器 1.1 分页显示数据 因为聊天信息数目很多,所以adpter需要做分页处理,这里的分页处理是我自己实现的,如果有更好的办法欢迎在评论中告知.我们从友盟的反馈SDK中能得到聊天的list,我 ...