使用Docker Swarm快速搭建与部署你的服务集群

docker-swarm

初始化集群

准备了对应的机器(两个虚拟机),基本信息如下

IP 主机名 备注
192.168.1.8 ubuntu-1
192.168.1.5 ubuntu-1

注意:最好保持每个节点的docker版本号为最新且是相同的

在主节点(manager)上执行

root@ubuntu:/home/wangxc# docker swarm init --advertise-addr  192.168.1.8

结果

Swarm initialized: current node (oqela4wtpa9m7e8a6zi9k9rbl) is now a manager.

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

    docker swarm join --token SWMTKN-1-03md8tqw24sd0tbxkyqxmiay5nixniax9c301f49qjorhsj069-44eeph3lldj3lopzk7tiiv1ve 192.168.1.8:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值