Docker Cookbook


| Chapter 6: Optimized Operating System Distributions for Docker



Download 6,31 Mb.
Pdf ko'rish
bet143/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   139   140   141   142   143   144   145   146   ...   260
Bog'liq
Docker Cookbook

174 | Chapter 6: Optimized Operating System Distributions for Docker


6.3 Starting a CoreOS Cluster via Vagrant to Run
Containers on Multiple Hosts
Problem
You want to become familiar with some of the CoreOS features and add-ons (e.g.,
etcd

fleet
) to manage a cluster of Docker hosts.
Solution
If you have not done so already, clone the CoreOS Vagrant project from GitHub and
set the configuration files:
$ git clone https://github.com/coreos/coreos-vagrant.git
$ cd coreos-vagrant/
$ cp config.rb.sample config.rb
$ cp user-data.sample user-data
You will use the same Vagrantfile as in 
Recipe 6.1
but specify the number of instances
you want in your cluster in the 
config.rb
file. This cluster will be made of a set of Cor‐
eOS instances started by Vagrant in VirtualBox or potentially VMware Fusion.
In 
Recipe 6.2
, you saw how to modify the user data to run a container at boot time. In
Recipe 6.1
, you modified the 
config.rb
file to expose port 2375 and access the Docker
daemon remotely. To bootstrap a CoreOS cluster with Vagrant, you need to edit the
config.rb
file to specify the number of instances in the cluster. For example,
$num_instances=4
will start four CoreOS instances.
In addition, at the top of the 
config.rb
file you will see some Ruby code that edits the
user-data
file to set a 
discovery
key in this YAML file. This uses a discovery service
run by the CoreOS team to help you run 
etcd
 on your cluster instances. 
etcd
is a
highly available key-value store for shared configuration and discovery that can be
used in conjunction with CoreOS. It is similar to other service-discovery solutions
like 
Apache ZooKeeper
 or 
Consul
. You could run 
etcd
on a different machine, but in
this recipe you will take advantage of the Vagrantfile definition to run it in a multima‐
chine configuration on the cluster nodes that you will start. 
etcd
will allow the
Docker hosts to discover themselves and help scheduling of the containers.
Discussion on 
etcd
is outside the scope of this cookbook. CoreOS
provides a convenient 
etcd
-based 
discovery
service to help with
bootstrapping your CoreOS cluster. This is used in this Vagrant
setup but is not recommended in production.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   139   140   141   142   143   144   145   146   ...   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