我有一个包含 2 个服务的堆栈: 1. dockercloud/haproxy 作为负载均衡器 2. mycustom/nginx 用于 ssl 终止
我有 2 个主机,每个服务有 2 个容器。每个主机上一个。主机 1:* Haproxy-1(IP:10.7.0.9)* Nginx-1(IP:10.7.0.7)
主机 2:* Haproxy 2(IP:10.7.0.10)* Nginx 2(IP:10.7.0.8)
问题是我无法从主机 1 上的容器连接到主机 2 上的容器。当在主机 1 上连接并尝试跟踪 Haproxy 2 (10.7.0.7) 时,我得到了这个:
跟踪路由到 10.7.0.7 (10.7.0.7),最多 30 跳,60 字节数据包 1 10.7.255.254 (10.7.255.254) 2997.863 ms !H 2997.704 ms !H 2997.684 ms !H
任何建议如何解决这个问题?
编辑
码头工人信息
Containers: 12
Running: 11
Paused: 0
Stopped: 1
Images: 12
Server Version: 1.11.1-cs1
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 90
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge weavemesh
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 5.813 GiB
Name: Debian-85-jessie-64-minimal
ID: BV3I:KVWH:L45Q:CV2D:IOTX:BG7W:YAUV:S4QG:AJ44:BTVK:J3VJ:RWJA
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
码头工人版本
Client:
Version: 1.11.1-cs1
API version: 1.23
Go version: go1.5.4
Git commit: bfd1f99
Built: Wed Apr 27 22:35:34 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.1-cs1
API version: 1.23
Go version: go1.5.4
Git commit: bfd1f99
Built: Wed Apr 27 22:35:34 2016
OS/Arch: linux/amd64
码头工人网络 ls
NETWORK ID NAME DRIVER
719bbcb667f2 bridge bridge
acb91ed95ada dockercloud weavemesh
c4be8b540ad6 host host
c57e28b9d274 none null
8d3859eb8bfd weave weavemesh
我使用 dockercloud 来设置服务。所以我自己没有使用任何命令。
编辑 2
这是 nginx-1 的 ifconfig:
eth0 Link encap:Ethernet HWaddr 02:42:AC:11:00:07
inet addr:172.17.0.7 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:7%32596/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:530 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:45267 (44.2 KiB) TX bytes:956 (956.0 B)
ethwe1 Link encap:Ethernet HWaddr DE:1C:3F:DF:E9:0C
inet addr:10.7.0.7 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::dc1c:3fff:fedf:e90c%32596/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1410 Metric:1
RX packets:62 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5164 (5.0 KiB) TX bytes:648 (648.0 B)
这是 nginx-2 的 ifconfig:
eth0 Link encap:Ethernet HWaddr 02:42:AC:11:00:08
inet addr:172.17.0.8 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:8%32566/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:174 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14399 (14.0 KiB) TX bytes:2076 (2.0 KiB)
ethwe1 Link encap:Ethernet HWaddr B2:A0:36:AF:0B:95
inet addr:10.7.0.8 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::b0a0:36ff:feaf:b95%32566/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1410 Metric:1
RX packets:643722 errors:0 dropped:0 overruns:0 frame:0
TX packets:369311 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:66498273 (63.4 MiB) TX
字节:31055890(29.6 MiB)