Docker Cookbook


See Also • Deploying Mesos in  seven commands • Mesos  frameworks 7.3 Starting Containers on a Cluster with Docker Swarm



Download 6,31 Mb.
Pdf ko'rish
bet161/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   157   158   159   160   161   162   163   164   ...   260
Bog'liq
Docker Cookbook

See Also
• Deploying Mesos in 
seven commands
• Mesos 
frameworks
7.3 Starting Containers on a Cluster with Docker Swarm
Problem
You know how to use Docker with a single host. You would like to start containers on
a cluster of hosts while keeping the user experience of the Docker CLI you are accus‐
tomed to on a single machine.
Solution
Use Docker 
Swarm
. Docker Swarm, the native clustering tool for Docker, allows a
user to access a pool of Docker hosts as if it were a single host. Docker Swarm was
announced at 
DockerCon
Europe in December 2014. The first beta release of Swarm
was 
announced
on February 26, 2015. As of this writing, Docker Swarm is still in
Beta.
To ease testing of Docker 
Swarm
, I provide a Vagrant setup and bootstrap scripts that
set up a four-node Swarm cluster. The cluster is composed of one head node and
three compute nodes, all running Ubuntu 14.04. To get the cluster up, clone the Git
repository accompanying this book (if you have not done so already), and head to the
ch07
directory and the 
swarm
subdirectory. Use Vagrant to boot the cluster:
$ git clone https://github.com/how2dock/docbook.git
$ cd docbook/ch07/swarm/
$ vagrant up
You should see four virtual machines being started by Vagrant. The machines will be
bootstrapped via bash scripts defined in the Vagrantfile:
.
.
.
$bootstrap
=<<
SCRIPT
apt
-
get
update
curl
-
sSL
https
:
//
get
.
docker
.
com
/
|
sudo
sh
gpasswd
-
a
vagrant
docker
echo
"DOCKER_OPTS=\"-H tcp://0.0.0.0:2375\""
>>
/etc/
default
/
docker
service
docker
restart
SCRIPT
$swarm
=<<
SCRIPT
apt
-
get
update
curl
-
sSL
https
:
//
get
.
docker
.
com
/
|
sudo
sh
gpasswd
-
a
vagrant
docker

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   157   158   159   160   161   162   163   164   ...   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