docker swarn集群笔记

Posted vijayfly

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker swarn集群笔记相关的知识,希望对你有一定的参考价值。

1.安装Docker 三剑客:
curl -L https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine


yum -y install python-pip
pip install docker-compose






[[email protected] webapps]# docker swarm init --advertise-addr 10.60.10.39
Swarm initialized: current node (w45qdtntwrpr97ty8ldtu4sw7) is now a manager.

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

    docker swarm join     --token SWMTKN-1-24911fv7pfba7781s1kjg381xhdsgs6amkrsfyiyp9qonhfmuk-0fgnqz2zi5yzwc7gs2d7ktasw     10.60.10.69:2377

To add a manager to this swarm, run docker swarm join-token manager and follow the instructions.


docker swarm join     --token SWMTKN-1-2rpog039x8lrihu3z1vpkaa9ju2klwsyujya7lhlr8gwzw4x1m-2t4e9l2ummijrj0769sk24mwl     10.60.10.39:2377


docker node ls


docker network create --driver overlay doceker_test_net01
docker network ls

#所有节点
docker pull nginx

docker service create --replicas 3 --name myNgx --network=doceker_test_net01 nginx


docker service ps myNgx
docker service ls
docker service scale myNgx=2

docker service update --image nginx myNgx


docker service rm myNgx

 

以上是关于docker swarn集群笔记的主要内容,如果未能解决你的问题,请参考以下文章

Docker 学习笔记总结

Docker&Kubernetes ❀ Kubernetes集群实践与部署笔记知识点梳理

用Docker在一台笔记本电脑上搭建一个具有10个节点7种角色的Hadoop集群(下)-搭建Hadoop集群

Docker&Kubernetes ❀ Kubernetes集群实践与部署笔记知识点梳理

Docker 与 K8S学习笔记(十七)—— 在K8S集群中部署应用

Docker笔记三:基于LVS DR模式构建WEB服务集群