docker工具之构建集群实现负载均衡

构建集群:实验环境:rhel7.3test1: 主节点test2: test3:排错:scp报错怎么办?[root@foundation52 kiosk]# scp docker-engine-* 172.25.52.33:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ WARNING:...
摘要由CSDN通过智能技术生成

构建集群

实验环境:rhel7.3

test1: 172.25.52.11  主节点
test2: 172.25.52.22  辅节点
test3: 172.25.52.33  辅节点

实验:
(1).搭建实验环境

做此实验的前提是真机已经完成了证书的制作

[root@test1 ~]# ls
anaconda-ks.cfg
docker-engine-17.03.1.ce-1.el7.centos.x86_64.rpm
docker-engine-selinux-17.03.1.ce-1.el7.centos.noarch.rpm
[root@test1 ~]# yum install *
[root@test1 ~]# systemctl start docker
[root@test1 ~]# yum install -y bash-*
[root@test1 ~]# docker swarm init
Swarm initialized: current node (534lg9252rj3w8s88o0lb8kkz) is now a manager.

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

    docker swarm join \
    --token SWMTKN-1-4331clm1g9imylu1ymt8lgg04ou64wxrnjmnacc9tu3cu96340-294r7jtbu5rz4xpocyxhb89ib \
    172.25.52.11:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
[root@test2 ~]# ls
anaconda-ks.cfg
docker-engine-17.03.1.ce-1.el7.centos.x86_64.rpm
docker-engine-selinux-17.03.1.ce-1.el7.centos.noarch.rpm
[root@test2 ~]# yum install -y *
[root@test2 ~]# systemctl start docker
[root@test2 ~]# docker swarm join \
>     --token SWMTKN-1-4331clm1g9imylu1ymt8lgg04ou64wxrnjmnacc9tu3cu96340-294r7jtbu5rz4xpocyxhb89ib \
>     172.25.52.11:2377
This node joined a swarm as a worker.

[root@test3 ~]# ls
anaconda-ks.cfg
docker-engine-17.03.1.ce-1.el7.centos.x86_64.rpm
docker-engine-selinux-17.03.1.ce-1.el7.centos.noarch.rpm
[root@test3 ~]# yum install * -y
[root@test3 ~]# systemctl start docker
[root@test3 ~]# docker swarm join \
>     --token SWMTKN-1-4331clm1g9imylu1ymt8lgg04ou64wxrnjmnacc9tu3cu96340-294r7jtbu5rz4xpocyxhb89ib \
>     172.25.52.11:2377
This node joined a swarm as a worker.
测试:
[root@test1 ~]# docker node ls
ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
534lg9252rj3w8s88o0lb8kkz *  test1     Ready   Active        Leader
89</
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值