【求助】docker 1.12 swarm 部分节点容器互联异常


swarm集群三台机器
ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
3amd7159bqbef6jjuqtzvkc9b    i2        Ready   Active        
92qhm6qhvtlrg9y3cqhudi20w *  i1        Ready   Active        Leader
eplawj2jqyyblgaxv57ass39m    i3        Ready   Active        


二个service,分别是zookeeper和1个web,web依赖zk
docker service create \
--name zk \
--env MYID=1 \
--env SERVERS=zk \
--network my-network \
--endpoint-mode dnsrr \
mesoscloud/zookeeper

docker service create \
--name dubboadmin \
--network my-network \
--publish 18112:8080 \
--endpoint-mode vip \
dubboadmin:1.0


web scale了4份,分布在2个节点

docker service ps dubboadmin

ID                         NAME          IMAGE                              NODE  DESIRED STATE  CURRENT STATE                   ERROR
9clrsdkn3c79q4wkczz8pw70h  dubboadmin.1  dubboadmin:1.0  i1    Running        Running 25 seconds ago          
2ttkw53wkyn21x321k9vtntf1  dubboadmin.2  dubboadmin:1.0  i1    Running        Running 4 seconds ago           
99mwnf1bqzwhhn5db8vpf53z7  dubboadmin.3  dubboadmin:1.0  i1    Running        Running 4 seconds ago           
bi1ju74yh55umiydbuptqe6sb  dubboadmin.4  dubboadmin:1.0  i2    Running        Running less than a second ago  


问题
i1节点上的容器都报异常
Caused by: java.net.UnknownHostException: zk
    at java.net.InetAddress.getAllByName0(InetAddress.java:1273)
    at java.net.InetAddress.getAllByName(InetAddress.java:1185)
    at java.net.InetAddress.getAllByName(InetAddress.java:1119)
    at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
    at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:64)
    ... 70 more


i2节点上的容器正常,ping zk正常
已邀请:

xiangxu

赞同来自: Henry14


docker host 上卸载 NetworkManager 试试.

service NetworkManager stop
yum remove -y NetworkManager
chkconfig network on
service network start

Henry14

赞同来自:


谁能解答我的问题

Henry14

赞同来自:


网卡刷一下,重新构建swarm集群,问题解决了@xiangxu

要回复问题请先登录注册