shipyard 同etcd進(jìn)行服務(wù)發(fā)現(xiàn),,docker-machine 使用swarm自帶管理,,目前兩者集群不能一起使用,。 1,,設(shè)置下載源 #docker默認(rèn)下載源,,下了一整天都沒(méi)下載下來(lái),,改成國(guó)內(nèi)源 分分鐘搞定 test@ubuntu:~$ curl -sSL https://get./daotools/set_mirror.sh |sudo sh -s http://abcd1234.m. docker version >= 1.12 {"registry-mirrors": ["http://abcd1234.m."]} Success. You need to restart docker to take effect: sudo systemctl restart docker.service test@ubuntu:~$ sudo systemctl restart docker.service 2,、安裝shipyard #現(xiàn)在軟件安裝方式越來(lái)越安逸了,一條命令就完成,,最后還提示登陸或者發(fā)開(kāi)放式 test@ubuntu:~$ curl -s https://shipyard-project.com/deploy | sudo bash -s Unable to find image 'alpine:latest' locally latest: Pulling from library/alpine 88286f41530e: Pulling fs layer 88286f41530e: Verifying Checksum 88286f41530e: Download complete 88286f41530e: Pull complete Digest: sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe Status: Downloaded newer image for alpine:latest Deploying Shipyard -> Starting Database Unable to find image 'rethinkdb:latest' locally latest: Pulling from library/rethinkdb 9f0706ba7422: Pulling fs layer 13cff7bd7d5f: Pulling fs layer 2f7f87e28358: Pulling fs layer 4f5c608387ab: Pulling fs layer 0168e87b5569: Pulling fs layer 4f5c608387ab: Waiting 0168e87b5569: Waiting 2f7f87e28358: Verifying Checksum 2f7f87e28358: Download complete 13cff7bd7d5f: Verifying Checksum 13cff7bd7d5f: Download complete 0168e87b5569: Verifying Checksum 0168e87b5569: Download complete 4f5c608387ab: Verifying Checksum 4f5c608387ab: Download complete 9f0706ba7422: Verifying Checksum 9f0706ba7422: Download complete 9f0706ba7422: Pull complete 13cff7bd7d5f: Pull complete 2f7f87e28358: Pull complete 4f5c608387ab: Pull complete 0168e87b5569: Pull complete Digest: sha256:e752a5624ab4c0724d1c2c5201e09c8d88de290bafd85f026ddb53cc21a31717 Status: Downloaded newer image for rethinkdb:latest -> Starting Discovery Unable to find image 'microbox/etcd:latest' locally latest: Pulling from microbox/etcd 8ded6e8ab3fd: Pulling fs layer bf8f85223d7a: Pulling fs layer a3ed95caeb02: Pulling fs layer a3ed95caeb02: Verifying Checksum a3ed95caeb02: Download complete bf8f85223d7a: Verifying Checksum bf8f85223d7a: Download complete 8ded6e8ab3fd: Verifying Checksum 8ded6e8ab3fd: Download complete 8ded6e8ab3fd: Pull complete bf8f85223d7a: Pull complete a3ed95caeb02: Pull complete Digest: sha256:941fd46b4eab265c65da9bfbf33397b853a7cef6c16df93a1e3fea7b4e47fc90 Status: Downloaded newer image for microbox/etcd:latest -> Starting Cert Volume -> Starting Proxy Unable to find image 'shipyard/docker-proxy:latest' locally latest: Pulling from shipyard/docker-proxy 8f4ec95ceaee: Pulling fs layer ac77a345f217: Pulling fs layer 43039e3ef672: Pulling fs layer a3ed95caeb02: Pulling fs layer a3ed95caeb02: Waiting 43039e3ef672: Verifying Checksum 43039e3ef672: Download complete a3ed95caeb02: Verifying Checksum a3ed95caeb02: Download complete 8f4ec95ceaee: Verifying Checksum 8f4ec95ceaee: Download complete 8f4ec95ceaee: Pull complete ac77a345f217: Verifying Checksum ac77a345f217: Download complete ac77a345f217: Pull complete 43039e3ef672: Pull complete a3ed95caeb02: Pull complete Digest: sha256:da6bbd1a145581a940d44940cce0f43705d7f8ec552a4e97e77104ec1b6dc3d1 Status: Downloaded newer image for shipyard/docker-proxy:latest -> Starting Swarm Manager -> Starting Swarm Agent -> Starting Controller Unable to find image 'shipyard/shipyard:latest' locally latest: Pulling from shipyard/shipyard cb5507795515: Pulling fs layer fd711d385b34: Pulling fs layer 9f2a509de079: Pulling fs layer a5251eb716bb: Pulling fs layer a5251eb716bb: Waiting cb5507795515: Verifying Checksum cb5507795515: Download complete cb5507795515: Pull complete 9f2a509de079: Verifying Checksum 9f2a509de079: Download complete a5251eb716bb: Verifying Checksum a5251eb716bb: Download complete fd711d385b34: Verifying Checksum fd711d385b34: Download complete fd711d385b34: Pull complete 9f2a509de079: Pull complete a5251eb716bb: Pull complete Digest: sha256:5f065362680fa4565dd150c8da3edd09b79a7a3010d3ceef20093c2a879187e0 Status: Downloaded newer image for shipyard/shipyard:latest Waiting for Shipyard on 192.168.1.80:8080 Shipyard available at http://192.168.1.80:8080 Username: admin Password: shipyard
3,、添加其他節(jié)點(diǎn) test@swarm-node1:~$ curl -sSL https://shipyard-project.com/deploy | ACTION=node DISCOVERY=etcd://192.168.1.80:4001 bash -s Adding Node -> Starting Cert Volume Unable to find image 'alpine:latest' locally latest: Pulling from library/alpine 88286f41530e: Pulling fs layer 88286f41530e: Verifying Checksum 88286f41530e: Download complete 88286f41530e: Pull complete Digest: sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe Status: Downloaded newer image for alpine:latest -> Starting Proxy Unable to find image 'shipyard/docker-proxy:latest' locally latest: Pulling from shipyard/docker-proxy 8f4ec95ceaee: Pulling fs layer ac77a345f217: Pulling fs layer 43039e3ef672: Pulling fs layer a3ed95caeb02: Pulling fs layer a3ed95caeb02: Waiting 43039e3ef672: Verifying Checksum 43039e3ef672: Download complete a3ed95caeb02: Verifying Checksum a3ed95caeb02: Download complete ac77a345f217: Verifying Checksum ac77a345f217: Download complete 8f4ec95ceaee: Verifying Checksum 8f4ec95ceaee: Download complete 8f4ec95ceaee: Pull complete ac77a345f217: Pull complete 43039e3ef672: Pull complete a3ed95caeb02: Pull complete Digest: sha256:da6bbd1a145581a940d44940cce0f43705d7f8ec552a4e97e77104ec1b6dc3d1 Status: Downloaded newer image for shipyard/docker-proxy:latest -> Starting Swarm Manager -> Starting Swarm Agent Node added to Swarm: 192.168.1.73 3 登陸 Shipyard頁(yè)面 查看節(jié)點(diǎn) 4 搭建 swarm集群 主控節(jié)點(diǎn) test@swarm-master:~$ docker swarm init Swarm initialized: current node (ly3wrhojt6ekl7gni6m5akdag) is now a manager. To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-5aqwhpkhcdunwdijo7v1vo320fllw6obnitpsj7ao9gtlirli5-42aqjvopqiftcggjsgk7m6122 192.168.1.80:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions. 節(jié)點(diǎn) test@swarm-node1:~$ docker swarm join --token SWMTKN-1-5aqwhpkhcdunwdijo7v1vo320fllw6obnitpsj7ao9gtlirli5-42aqjvopqiftcggjsgk7m6122 192.168.1.80:2377 This node joined a swarm as a worker. 5 測(cè)試 5.1 主控節(jié)點(diǎn)執(zhí)行添加service test@swarm-master:~$ docker service create --replicas 2 --name myhelloworld alpine ping docker.com 6vwul8y2c16a9kyt13zof2cvb Since --detach=false was not specified, tasks will be created in the background. In a future release, --detach=false will become the default. #web界面查詢一下2個(gè)新增容器 5.2 擴(kuò)展容器 test@swarm-master:~$ docker service scale myhelloworld=10 myhelloworld scaled to 10 #web頁(yè)面看一下,,10個(gè)容器
|
|
來(lái)自: 阿青哥Joe > 《云計(jì)算,、虛擬化》