老师,我用的是单机的swarm,没有worker,在client中可以ping whoami,nslookup,获取地址的时候出错
来源:7-5 集群服务间通信之Routing Mesh
别低头i_3586211
2018-10-31
service 的信息如下
docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
b3p56tapzjch client replicated 1/1 busybox:latest
otahacat91uh whoami replicated 1/1 jwilder/whoami:latest *:8000->8000/tcp
这个是client容器内的信息
/ # ping whoami
PING whoami (10.0.0.3): 56 data bytes
64 bytes from 10.0.0.3: seq=0 ttl=64 time=0.073 ms
64 bytes from 10.0.0.3: seq=1 ttl=64 time=0.105 ms
64 bytes from 10.0.0.3: seq=2 ttl=64 time=0.088 ms
64 bytes from 10.0.0.3: seq=3 ttl=64 time=0.090 ms
^C
--- whoami ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.073/0.089/0.105 ms
/ # nslookup tasks.whoami
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
*** Can't find tasks.whoami: No answer
/ # nslookup whoami
Server: 127.0.0.11
Address: 127.0.0.11:53
Non-authoritative answer:
*** Can't find whoami: No answer
网络信息,用的demo
NETWORK ID NAME DRIVER SCOPE
76d07f4f181d bridge bridge local
wofa8g7kn1di demo overlay swarm
3f19bdb2049f docker_gwbridge bridge local
c28d1d7442c1 host host local
mp4u97zpysmf ingress overlay swarm
4d0db1f0be88 none null local
写回答
3回答
-
Louis0o
2019-04-14
遇到同样的问题了,不知道这个问题解决了没有?
012019-04-15 -
麦兜搞IT
2018-11-01
因为我在尝试复现您的那个错误,但是一直没有复现出来。所以麻烦您告诉我你用的swarm的具体版本,还有敲过的docker 命令,我完全按照你的写法去一一复现一下。如果我按照你的做法一步步copy过来都不能复现,就真的帮不到你了。
022018-11-05 -
麦兜搞IT
2018-11-01
您好,很抱歉,因为这个问题确实没法准确回复,我这边没法重现您的这个错误。您要是方便,装个teamviewer,然后我可以约个时间,我远程下您的桌面,去您的环境里看看
012018-11-01
相似问题