Docker Cookbook



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

See Also
• Introduction to 
Swarm
• Swarm installation 
documentation
7.3 Starting Containers on a Cluster with Docker Swarm | 201


7.4 Using Docker Machine to Create a Swarm Cluster
Across Cloud Providers
Problem
You understand how to create a Swarm cluster manually (see 
Recipe 7.3
), but you
would like to create one with nodes in multiple public cloud providers and keep the
user experience of the local Docker CLI.
Solution
Use 
Docker Machine
 (see 
Recipe 1.9
) to start Docker hosts in several cloud providers
and bootstrap them automatically to create a Swarm cluster.
The first thing to do is to obtain a 
swarm
discovery token. This will be used during the
bootstrapping process when starting the nodes of the cluster. As explained in 
Recipe
7.3
, Swarm features multiple discovery processes. In this recipe, you use the service
hosted by Docker, Inc. A discovery token is obtained by running a container based on
the 
swarm
image and running the 
create
command. Assuming you do not have
access to a Docker host already, you use 
docker-machine
to create one solely for this
purpose:
$ ./docker-machine create -d virtualbox local
INFO[0000] Creating SSH key...
...
INFO[0042] To point your Docker client at it, run this in your shell: \
$(docker-machine env local)
$ eval "$(docker-machine env local)"
$ docker run swarm create
31e61710169a7d3568502b0e9fb09d66
With the token in hand, you can use 
docker-machine
and multiple public cloud driv‐
ers to start worker nodes. You can start a Swarm head node on VirtualBox, a worker
on DigitalOcean (see 
Figure 1-7
), and another one on Azure (see 
Recipe 8.6
).
Do not start a Swarm head in a public cloud and a worker on your
localhost with VirtualBox. Chances are the head will not be able to
route network traffic to your local worker node. It is possible to do,
but you would have to open ports on your local router.
$ docker-machine create -d virtualbox --swarm --swarm-master \
--swarm-discovery token://31e61710169a7d3568502b0e9fb09d66 head
INFO[0000] Creating SSH key...
...
INFO[0069] To point your Docker client at it, run this in your shell: \
$(docker-machine env head)

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   160   161   162   163   164   165   166   167   ...   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