Docker Cookbook


| Chapter 7: The Docker Ecosystem: Tools



Download 6,31 Mb.
Pdf ko'rish
bet165/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   161   162   163   164   165   166   167   168   ...   260
Bog'liq
Docker Cookbook

202 | Chapter 7: The Docker Ecosystem: Tools


$ docker-machine create -d digitalocean --swarm --swarm-discovery \
token://31e61710169a7d3568502b0e9fb09d66 worker-00
...
$ docker-machine create -d azure --swarm --swarm-discovery \
token://31e61710169a7d3568502b0e9fb09d66 swarm-worker-01
...
Your Swarm cluster is now ready. Your Swarm head node is running locally in a Vir‐
tualBox VM, one worker node is running in DigitalOcean, and another one in Azure.
You can set the local 
docker-machine
binary to use the head node running in Virtual‐
Box and start using the Swarm subcommands:
$ eval "$(docker-machine env --swarm head)"
$ docker info
Containers: 4
Nodes: 3
head: 192.168.99.103:2376
└ Containers: 2
└ Reserved CPUs: 0 / 4
└ Reserved Memory: 0 B / 999.9 MiB
worker-00: 45.55.160.223:2376
└ Containers: 1
└ Reserved CPUs: 0 / 1
└ Reserved Memory: 0 B / 490 MiB
swarm-worker-01: swarm-worker-01.cloudapp.net:2376
└ Containers: 1
└ Reserved CPUs: 0 / 1
└ Reserved Memory: 0 B / 1.639 GiB
Discussion
If you start a container, Swarm will schedule it in round-robin fashion on the cluster.
For example, you can start three Nginx containers in a 
for
loop:
$ for i in `seq 1 3`;do docker run -d -p 80:80 nginx;done
This leads to three Nginx containers on the three nodes in your cluster. Remember
that you will need to open port 80 on the instances running in the cloud to access the
container (e.g., see 
Recipe 8.6
):
$ docker ps
... IMAGE ... PORTS NAMES
... nginx:1.7 ... 443/tcp, 104.210.33.180:80->80/tcp swarm-worker-01/
loving_torvalds
... nginx:1.7 ... 443/tcp, 45.55.160.223:80->80/tcp worker-00/drunk_swartz
... nginx:1.7 ... 443/tcp, 192.168.99.103:80->80/tcp head/condescending_galileo

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   161   162   163   164   165   166   167   168   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish