Docker Cookbook


Running a Weave Network on AWS | 97



Download 6,31 Mb.
Pdf ko'rish
bet88/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   84   85   86   87   88   89   90   91   ...   260
Bog'liq
Docker Cookbook

3.12 Running a Weave Network on AWS | 97


See Also

Weave Getting Started Guides
3.13 Deploying flannel Overlay Between Docker Hosts
Contributed by Eugene Yakubovich
Problem
You want containers on different hosts to communicate with each other without port
mapping.
Solution
Use 
flannel
to create an overlay network for containers. Each container will be
assigned an IP that can be reachable from other hosts. Start by bringing up two vir‐
tual machines from a Vagrantfile:
$ git clone https://github.com/how2dock/docbook.git
$ cd ch03/flannel
$ vagrant up
This defines two virtual machines installed with Docker: 
etcd
and 
flannel
. The
“master” will run a key-value store (
etcd
) that 
flannel
uses for coordination.
Next, 
vagrant ssh master
and start 
etcd
in the background:
$ cd /opt/coreos/etcd-v2.0.13-linux-amd64
$ nohup ./etcd --listen-client-urls=http://0.0.0.0:2379 \
--advertise-client-urls=http://192.168.33.10:2379 &
Before starting the 
flannel
daemon, write the overlay network configuration into
etcd
. Be sure to pick a subnet range that does not conflict with other IP addresses:
$ ./etcdctl set /coreos.com/network/config '{ "Network": "10.100.0.0/16" }'
Now start the 
flannel
daemon. Notice that the 
--iface
option specifies the IP of the
private network given in the Vagrantfile. 
flannel
will forward encapsulated packets
over this interface:
$ cd /opt/coreos/flannel-0.5.1
$ sudo ./flanneld --iface=192.168.33.10 --ip-masq &
$ sudo ./mk-docker-opts.sh -c -d /etc/default/docker
flannel
will acquire a lease for a 
/24
subnet to be assigned to the 
docker0
bridge.
The acquired subnet will be written out to the 
/run/flannel/subnet.env
file. The

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   84   85   86   87   88   89   90   91   ...   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