$ curl -L https://github.com/docker/machine/releases/download/v0.9.0-rc2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
$ docker-machine create --driver virtualbox manager1 Running pre-create checks... (manager1) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com on [::1]:53: server misbehaving Creating machine... (manager1) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com on [::1]:53: server misbehaving (manager1) Copying /home/zuolan/.docker/machine/cache/boot2docker.iso to /home/zuolan/.docker/machine/machines/manager1/boot2docker.iso... (manager1) Creating VirtualBox VM... (manager1) Creating SSH key... (manager1) Starting the VM... (manager1) Check network to re-create if needed... (manager1) Found a new host-only adapter: "vboxnet0" (manager1) Waiting for an IP... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with boot2docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env manager1
$ docker-machine env manager1 export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/home/zuolan/.docker/machine/machines/manager1" export DOCKER_MACHINE_NAME="manager1" # Run this command to configure your shell: # eval $(docker-machine env manager1)
$ docker-machine create --driver virtualbox worker1
$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS manager1 - virtualbox Running tcp://192.168.99.100:2376 v1.12.3 worker1 - virtualbox Running tcp://192.168.99.101:2376 v1.12.3
$ docker-machine ssh manager1 docker swarm init --listen-addr 192.168.99.100:2377 --advertise-addr 192.168.99.100 Swarm initialized: current node (23lkbq7uovqsg550qfzup59t6) is now a manager. To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-c036gwrakjejql06klrfc585r 192.168.99.100:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
$ docker swarm init --listen-addr <MANAGER-IP>:<PORT>
$ docker-machine ssh worker1 docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-c036gwrakjejql06klrfc585r 192.168.99.100:2377 This node joined a swarm as a worker.
$ docker-machine ssh manager1 docker swarm init --listen-addr $MANAGER1_IP:2377 Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on different interfaces (10.0.2.15 on eth0 and 192.168.99.100 on eth1) - specify one with --advertise-addr exit status 1
$ docker-machine ssh manager1 docker swarm init --advertise-addr 192.168.99.100 --listen-addr 192.168.99.100:2377 Swarm initialized: current node (ahvwxicunjd0z8g0eeosjztjx) is now a manager. To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-c036gwrakjejql06klrfc585r 192.168.99.100:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
$ docker-machine ssh manager1 docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 23lkbq7uovqsg550qfzup59t6 * manager1 Ready Active Leader dqb3fim8zvcob8sycri3hy98a worker1 Ready Active
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS manager1 - virtualbox Running tcp://192.168.99.100:2376 v1.12.3 manager2 - virtualbox Running tcp://192.168.99.105:2376 v1.12.3 worker1 - virtualbox Running tcp://192.168.99.102:2376 v1.12.3 worker2 - virtualbox Running tcp://192.168.99.103:2376 v1.12.3 worker3 - virtualbox Running tcp://192.168.99.104:2376 v1.12.3
$ docker-machine ssh worker2 docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-c036gwrakjejql06klrfc585r 192.168.99.100:2377 This node joined a swarm as a worker.
$ docker-machine ssh worker3 docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-c036gwrakjejql06klrfc585r 192.168.99.100:2377 This node joined a swarm as a worker.
$ docker-machine ssh manager1 docker swarm join-token manager To add a manager to this swarm, run the following command: docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-8tn855hkjdb6usrblo9iu700o 192.168.99.100:2377
$ docker-machine ssh manager2 docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-8tn855hkjdb6usrblo9iu700o 192.168.99.100:2377 This node joined a swarm as a manager.
$ docker-machine ssh manager2 docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 16w80jnqy2k30yez4wbbaz1l8 worker1 Ready Active 2gkwhzakejj72n5xoxruet71z worker2 Ready Active 35kutfyn1ratch55fn7j3fs4x worker3 Ready Active a9r21g5iq1u6h31myprfwl8ln * manager2 Ready Active Reachable dpo7snxbz2a0dxvx6mf19p35z manager1 Ready Active Leader
$ docker swarm join --token SWMTKN-1-3z5rzoey0u6onkvvm58f7vgkser5d7z8sfshlu7s4oz2gztlvj-8tn855hkjdb6usrblo9iu700o 192.168.99.100:2377 This node joined a swarm as a manager.
$ docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 6z2rpk1t4xucffzlr2rpqb8u3 worker3 Ready Active 7qbr0xd747qena4awx8bx101s * user-pc Ready Active Reachable 9v93sav79jqrg0c7051rcxxev manager2 Ready Active Reachable a1ner3zxj3ubsiw4l3p28wrkj worker1 Ready Active a5w7h8j83i11qqi4vlu948mad worker2 Ready Active d4h7vuekklpd6189fcudpfy18 manager1 Ready Active Leader
$ docker network ls NETWORK ID NAME DRIVER SCOPE 764ff31881e5 bridge bridge local fbd9a977aa03 host host local 6p6xlousvsy2 ingress overlay swarm e81af24d643d none null local
$ docker network create --driver overlay swarm_test 4dm8cy9y5delvs5vd0ghdd89s $ docker network ls NETWORK ID NAME DRIVER SCOPE 764ff31881e5 bridge bridge local fbd9a977aa03 host host local 6p6xlousvsy2 ingress overlay swarm e81af24d643d none null local 4dm8cy9y5del swarm_test overlay swarm
$ docker-machine ssh manager1 docker pull reg.example.com/library/nginx:alpine alpine: Pulling from library/nginx e110a4a17941: Pulling fs layer ... ... 7648f5d87006: Pull complete Digest: sha256:65063cb82bf508fd5a731318e795b2abbfb0c22222f02ff5c6b30df7f23292fe Status: Downloaded newer image for reg.example.com/library/nginx:alpine $ docker-machine ssh manager2 docker pull reg.example.com/library/nginx:alpine alpine: Pulling from library/nginx e110a4a17941: Pulling fs layer ... ... 7648f5d87006: Pull complete Digest: sha256:65063cb82bf508fd5a731318e795b2abbfb0c22222f02ff5c6b30df7f23292fe Status: Downloaded newer image for reg.example.com/library/nginx:alpine $ docker-machine ssh worker1 docker pull reg.example.com/library/nginx:alpine alpine: Pulling from library/nginx e110a4a17941: Pulling fs layer ... ... 7648f5d87006: Pull complete Digest: sha256:65063cb82bf508fd5a731318e795b2abbfb0c22222f02ff5c6b30df7f23292fe Status: Downloaded newer image for reg.example.com/library/nginx:alpine $ docker-machine ssh worker2 docker pull reg.example.com/library/nginx:alpine alpine: Pulling from library/nginx e110a4a17941: Pulling fs layer ... ... 7648f5d87006: Pull complete Digest: sha256:65063cb82bf508fd5a731318e795b2abbfb0c22222f02ff5c6b30df7f23292fe Status: Downloaded newer image for reg.example.com/library/nginx:alpine $ docker-machine ssh worker3 docker pull reg.example.com/library/nginx:alpine alpine: Pulling from library/nginx e110a4a17941: Pulling fs layer ... ... 7648f5d87006: Pull complete Digest: sha256:65063cb82bf508fd5a731318e795b2abbfb0c22222f02ff5c6b30df7f23292fe Status: Downloaded newer image for reg.example.com/library/nginx:alpine
$ docker service create --replicas 2 --name helloworld --network=swarm_test nginx:alpine 5gz0h2s5agh2d2libvzq6bhgs
$ docker service ls ID NAME REPLICAS IMAGE COMMAND 5gz0h2s5agh2 helloworld 0/2 nginx:alpine
$ docker service ps helloworld ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR ay081uome3 helloworld.1 nginx:alpine manager1 Running Preparing 2 seconds ago 16cvore0c96 helloworld.2 nginx:alpine worker2 Running Preparing 2 seconds ago
$ docker-machine ssh manager1 docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 119f787622c2 nginx:alpine "nginx -g ..." 4 minutes ago Up 4 minutes 80/tcp, 443/tcp hello ... $ docker-machine ssh worker2 docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5db707401a06 nginx:alpine "nginx -g ..." 4 minutes ago Up 4 minutes 80/tcp, 443/tcp hello ...
helloworld.1.ay081uome3eejeg4mspa8pdlx helloworld.2.16cvore0c96rby1vp0sny3mvt
$ docker-machine ssh manager1 docker exec -i helloworld.1.ay081uome3eejeg4mspa8pdlx ping helloworld.2.16cvore0c96rby1vp0sny3mvt PING helloworld.2.16cvore0c96rby1vp0sny3mvt (10.0.0.4): 56 data bytes 64 bytes from 10.0.0.4: seq=0 ttl=64 time=0.591 ms 64 bytes from 10.0.0.4: seq=1 ttl=64 time=0.594 ms 64 bytes from 10.0.0.4: seq=2 ttl=64 time=0.624 ms 64 bytes from 10.0.0.4: seq=3 ttl=64 time=0.612 ms ^C
$ docker-machine ssh worker2 docker exec -i helloworld.2.16cvore0c96rby1vp0sny3mvt ping helloworld.1.ay081uome3eejeg4mspa8pdlx PING helloworld.1.ay081uome3eejeg4mspa8pdlx (10.0.0.3): 56 data bytes 64 bytes from 10.0.0.3: seq=0 ttl=64 time=0.466 ms 64 bytes from 10.0.0.3: seq=1 ttl=64 time=0.465 ms 64 bytes from 10.0.0.3: seq=2 ttl=64 time=0.548 ms 64 bytes from 10.0.0.3: seq=3 ttl=64 time=0.689 ms ^C
$ docker-machine ssh worker2 ping helloworld.1.ay081uome3eejeg4mspa8pdlx PING helloworld.1.ay081uome3eejeg4mspa8pdlx (221.179.46.190): 56 data bytes 64 bytes from 221.179.46.190: seq=0 ttl=63 time=48.651 ms 64 bytes from 221.179.46.190: seq=1 ttl=63 time=63.239 ms 64 bytes from 221.179.46.190: seq=2 ttl=63 time=47.686 ms 64 bytes from 221.179.46.190: seq=3 ttl=63 time=61.232 ms ^C $ docker-machine ssh manager1 ping helloworld.2.16cvore0c96rby1vp0sny3mvt PING helloworld.2.16cvore0c96rby1vp0sny3mvt (221.179.46.194): 56 data bytes 64 bytes from 221.179.46.194: seq=0 ttl=63 time=30.150 ms 64 bytes from 221.179.46.194: seq=1 ttl=63 time=54.455 ms 64 bytes from 221.179.46.194: seq=2 ttl=63 time=73.862 ms 64 bytes from 221.179.46.194: seq=3 ttl=63 time=53.171 ms ^C
$ docker service rm helloworld helloworld
$ docker service create --replicas 2 --name helloworld -p 7080:80 --network=swarm_test nginx:alpine 9gfziifbii7a6zdqt56kocyun
$ docker service ls ID NAME REPLICAS IMAGE COMMAND 9gfziifbii7a helloworld 2/2 nginx:alpine
$ docker service ps helloworld ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR 9ikr3agyi... helloworld.1 nginx:alpine user-pc Running Running 13 seconds ago 7acmhj0u... helloworld.2 nginx:alpine worker2 Running Running 6 seconds ago
$ docker-machine ssh worker2 docker kill helloworld.2.7acmhj0udzusv1d7lu2tbuhu4 helloworld.2.7acmhj0udzusv1d7lu2tbuhu4
$ docker service ps helloworld ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR 9ikr3agyi... helloworld.1 nginx:alpine zuolan-pc Running Running 19 minutes ago 8f866igpl... helloworld.2 nginx:alpine manager1 Running Running 4 seconds ago 7acmhj0u... _ helloworld.2 nginx:alpine worker2 Shutdown Failed 11 seconds ago ...exit... $ docker service ls ID NAME REPLICAS IMAGE COMMAND 9gfziifbii7a helloworld 2/2 nginx:alpine
$ docker service scale helloworld=3 helloworld scaled to 3
$ docker service ps helloworld ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR 9ikr3agyi... helloworld.1 nginx:alpine user-pc Running Running 30 minutes ago 8f866igpl... helloworld.2 nginx:alpine manager1 Running Running 11 minutes ago 7acmhj0u... _ helloworld.2 nginx:alpine worker2 Shutdown Failed 11 minutes ago exit137 1vexr1jm... helloworld.3 nginx:alpine worker2 Running Running 4 seconds ago
$ docker service scale helloworld=2 helloworld scaled to 2
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有