Docker Cookbook


| Chapter 10: Application Use Cases



Download 6,31 Mb.
Pdf ko'rish
bet249/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   245   246   247   248   249   250   251   252   ...   260
Bog'liq
Docker Cookbook

320 | Chapter 10: Application Use Cases


172.21.0.9 node3
172.21.0.9 node3.multihost
This recipe is interesting because using Docker Network allows you to use the exact
same deployment methodology that you would have used on a single Docker host.
Discussion
Try adding more Galera nodes, killing some, and you will see that the cluster size
varies.
See Also

Blog post on building a Galera cluster on a single Docker host

Blog post on building a Galera cluster on multiple Docker hosts
10.6 DATA: Dynamically Configuring a Load-Balancer for a
MySQL Galera Cluster
Problem
Recipe 10.5
created a multinode Galera cluster on two Docker hosts, taking advantage
of the Docker Network capability to create a network overlay. Now you would like to
automatically configure a load-balancer to share the load among all the nodes of this
Galera cluster.
Solution
Use the setup described in 
Recipe 10.3
. Use 
registrator
to dynamically register the
MySQL nodes in a key-value store like Consul, and use 
confd
to manage an 
nginx
template that will balance the load among the Galera cluster nodes. 
Figure 10-5
depicts a two-node setup in which Docker Network is used across the nodes
regis
trator
runs to publish the services running on each node, and Nginx runs on one of
the nodes to provide load-balancing between these nodes.
10.6 DATA: Dynamically Configuring a Load-Balancer for a MySQL Galera Cluster | 321


Figure 10-5. Dynamic load balancing of a Galera cluster
Run 
registrator
on each host, pointing to the consul-server running on the separate
VM at 
192.168.33.10
and start the first two nodes of the Galera cluster using the
image 
erkules/galera:basic
.
On 
mysql-1
at 
192.168.33.11
run the following:
$ docker run -d -v /var/run/docker.sock:/tmp/docker.sock
gliderlabs/registrator
-ip 192.168.33.11 consul://192.168.33.10:8500/galera
$ docker run -d --name node1
-h node1 erkules/galera:basic
--wsrep-cluster-name=local-test --wsrep-cluster-address=gcomm://
On 
mysql-2
at 
192.168.33.12
use this:
$ docker run -d -v /var/run/docker.sock:/tmp/docker.sock
gliderlabs/registrator

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   245   246   247   248   249   250   251   252   ...   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