Arama butonu
Bu konudaki kullanıcılar: 1 misafir
1
Cevap
191
Tıklama
0
Öne Çıkarma
docker container network
L
2 yıl
Yüzbaşı
Konu Sahibi

herkese slm...

docker swarm komutu ile başlattığım 3 tane container'ım var bunlardan iki tanesi istediğim dış ip'ye bağlanabilirken bir tanesi timeouta düşüyor. Bu şekilde fazla detay vermeden çözmeniz zor tabiki detay istenirse konu devamında verebilirim?

Docker konteynırlar overlay network kullanıyorlar.

aşağıdaki çalışan docker konteynırların listesi var. betik_oto_api isimli konteynır hariç, hepsi 10.0.0.3 nolu ip'ye ping atabiliyor
quote:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cb9daa4fae9f betikdocker/postgres:latest "docker-entrypoint.s…" 46 minutes ago Up 46 minutes 5432/tcp betik_oto_db
7454889dfd11 betikdocker/betik_oto:test "/entrypoint.sh bash…" 46 minutes ago Up 46 minutes 80/tcp, 443/tcp betik_oto_api
420e5dcaa222 betikdocker/betik_oto:test "/entrypoint.sh bash…" 47 minutes ago Up 46 minutes 80/tcp, 443/tcp betik_oto_celery_beat
f6313564ebc6 betikdocker/betik_oto:test "/entrypoint.sh bash…" 47 minutes ago Up 47 minutes 80/tcp, 443/tcp betik_oto_celery



aşağıda `docker network ls` komutunun çıktısı var. Tüm konteynırlarım betik_oto_default networkünü kullanıyor

quote:

NETWORK ID NAME DRIVER SCOPE
k4gvkikvn3zc betik_oto_default overlay swarm
16863c774dd9 bridge bridge local
dae305f33c81 docker_gwbridge bridge local
06e450c0d789 host host local
rtg9yf83en6n ingress overlay swarm
59457f368f02 none null local






Fiziksel makinede `ifconfig` komutu çıktısı aşağıdaki gibidir. Erişmeye çalıştığım ip 10.0.0.3 bu makine kurum içinde bulunuyor. Fiziksel makineden ping atılabiliyor

quote:

docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:f2:21:14:d2 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


docker_gwbridge: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
inet6 fe80::42:deff:feef:d1d7 prefixlen 64 scopeid 0x20<link>
ether 02:42:de:ef:d1:d7 txqueuelen 0 (Ethernet)
RX packets 2364 bytes 3546901 (3.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4065 bytes 10466808 (10.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.45 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::20c:29ff:fe26:86c1 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:26:86:c1 txqueuelen 1000 (Ethernet)
RX packets 202550 bytes 278184919 (278.1 MB)
RX errors 0 dropped 13 overruns 0 frame 0
TX packets 32264 bytes 8176666 (8.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 10123 bytes 1340812 (1.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10123 bytes 1340812 (1.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


veth49c44be: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::accb:bcff:fe7c:66c4 prefixlen 64 scopeid 0x20<link>
ether 72:7d:84:10:6f:d7 txqueuelen 0 (Ethernet)
RX packets 1777 bytes 3537096 (3.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1609 bytes 175813 (175.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


veth4c4c6ae: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::d0cc:2eff:fede:381d prefixlen 64 scopeid 0x20<link>
ether d2:cc:2e:de:38:1d txqueuelen 0 (Ethernet)
RX packets 345 bytes 24823 (24.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2233 bytes 9252934 (9.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


veth4f4c085: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::ac39:34ff:fe6f:c67f prefixlen 64 scopeid 0x20<link>
ether ae:39:34:6f:c6:7f txqueuelen 0 (Ethernet)
RX packets 48 bytes 3392 (3.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 60 bytes 21304 (21.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


veth62fa35c: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::8fc:f2ff:fec8:7641 prefixlen 64 scopeid 0x20<link>
ether 0a:fc:f2:c8:76:41 txqueuelen 0 (Ethernet)
RX packets 4 bytes 280 (280.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30 bytes 1888 (1.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


vethde3c3c4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::60ad:30ff:fe78:cb56 prefixlen 64 scopeid 0x20<link>
ether 62:ad:30:78:cb:56 txqueuelen 0 (Ethernet)
RX packets 4 bytes 280 (280.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 26 bytes 1720 (1.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


vethfd89034: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::5005:9eff:fea6:da99 prefixlen 64 scopeid 0x20<link>
ether 52:05:9e:a6:da:99 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 18 bytes 1272 (1.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0




aşağıdaki 10.0.0.3 nolu ip'ye ping gitmeyen containerın, `ifconfig` komutunun çıktısı. `docker exec -it betik_oto_api bash` ile konteynıra girip `ifconfig` komutunu çalıştırıyorum

quote:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet 10.0.2.17 netmask 255.255.255.0 broadcast 10.0.2.255
ether 02:42:0a:00:02:11 txqueuelen 0 (Ethernet)
RX packets 4442 bytes 888563 (867.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4452 bytes 1197666 (1.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet 10.0.0.13 netmask 255.255.255.0 broadcast 10.0.0.255
ether 02:42:0a:00:00:0d txqueuelen 0 (Ethernet)
RX packets 359 bytes 38966 (38.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 430 bytes 481163 (469.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.7 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:ac:12:00:07 txqueuelen 0 (Ethernet)
RX packets 2233 bytes 9252934 (8.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 345 bytes 24823 (24.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 136 bytes 10997 (10.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 136 bytes 10997 (10.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0





L
2 yıl
Çavuş

Merhaba

Tüm konteynırlarım betik_oto_default networkünü kullanıyor demişsin bunu göremedim tam olarak. Ve bir diğer sorum neden bridge olarak kullanmadın overlay tercih ettin ?



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.