zoukankan      html  css  js  c++  java
  • 095、如何创建Swarm集群?(Swarm02)

     
    本节我们将创建三节点的swarm集群(操作系统Ubuntu 16.04 ,Docker 版本均不低于 v1.12)。
     
    host01    10.12.31.211    swarm-worker1
    host02    10.12.31.212    swarm-worker2
    host03    10.12.31.213    swarm-manager
      
    root@host03:~# docker swarm init --advertise-addr 10.12.31.213    #    创建docker swarm
    Swarm initialized: current node (h6rzavsz2vjxstwj3pytiebjb) is now a manager.    #    第一个node自动成为 swarm-manager
     
    To add a worker to this swarm, run the following command:    #    提供添加 swarm-manager的命令
     
        docker swarm join --token SWMTKN-1-1n5mp7iz3isz5nuw2jdbzw76fx2a11a7a3r09h9wvfn6r2n2jn-3tnqqxq8h3chq8izf65e07379 10.12.31.213:2377
     
    To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.    #    提供添加 swarm-worker 的命令
     
    root@host03:~# docker node ls    #    查看当前node节点
    ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
    h6rzavsz2vjxstwj3pytiebjb *   host03              Ready               Active              Leader              18.09.6
     
    root@host01:~# docker swarm join --token SWMTKN-1-1n5mp7iz3isz5nuw2jdbzw76fx2a11a7a3r09h9wvfn6r2n2jn-3tnqqxq8h3chq8izf65e07379 10.12.31.213:2377
    This node joined a swarm as a worker.    #    host01 加入swarm集群,并设置为worker
     
    root@host02:~# docker swarm join --token SWMTKN-1-1n5mp7iz3isz5nuw2jdbzw76fx2a11a7a3r09h9wvfn6r2n2jn-3tnqqxq8h3chq8izf65e07379 10.12.31.213:2377
    This node joined a swarm as a worker.    #    host02 加入swarm集群,并设置为worker
     
    root@host03:~# docker node ls
    ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
    hvt2ez9e7zvqm2hz8nix1eke7     host01              Ready               Active                                  18.09.6
    asn5ufnogzkyqigk4mizatoer     host02              Ready               Active                                  18.09.6
    h6rzavsz2vjxstwj3pytiebjb *   host03              Ready               Active              Leader              18.09.6
    root@host03:~# docker swarm join-token worker    #    查看添加 swarm-manager 的命令
    To add a worker to this swarm, run the following command:
     
        docker swarm join --token SWMTKN-1-1n5mp7iz3isz5nuw2jdbzw76fx2a11a7a3r09h9wvfn6r2n2jn-3tnqqxq8h3chq8izf65e07379 10.12.31.213:2377
     
    root@host03:~# docker swarm join-token manager    #    查看添加 swarm-worker 的命令
    To add a manager to this swarm, run the following command:
     
        docker swarm join --token SWMTKN-1-1n5mp7iz3isz5nuw2jdbzw76fx2a11a7a3r09h9wvfn6r2n2jn-76l38n7buc60ju4fy1zzjtxcv 10.12.31.213:2377
     
     
     
  • 相关阅读:
    查询SQL数据库中表占用资源情况的语句
    修改VMware网卡MAC的方法
    Ajax 与 .net Validator
    控件属性值绑定到数据
    一个设计的小例子警察抓小偷
    加密Web.config 文件中的敏感信息
    VS .Net 2005程序集换名之后的遗留问题
    为ASP.Net 创建和配置应用程序服务数据库
    ArcGIS 9.0 在Windows XP SP2 上安装的问题(数据保护造成的)
    使用客户端脚本
  • 原文地址:https://www.cnblogs.com/www1707/p/10872707.html
Copyright © 2011-2022 走看看