无法连接到Docker内部的Coherence集群

我已经在两个容器中创build了一个简单的Coherence(3.7)集群。 一个容器有一个caching节点,另一个容器有一个代理节点。 两个容器都以网桥模式启动,我可以从日志文件中正确地看到它们形成一个集群:

MasterMemberSet( ThisMember=Member(Id=2, Timestamp=2017-11-14 14:13:50.376, Address=172.17.0.2:9155, MachineId=22297, Location=site:,rack:4500a,machine:f0ace732de72,process:23,member:proxy, Role=sandbox_proxy) OldestMember=Member(Id=1, Timestamp=2017-11-14 14:13:19.81, Address=172.17.0.3:8150, MachineId=20222, Location=site:,rack:4500a,machine:40e89ba7487c,process:24,member:storage, Role=sandbox_cache) ActualMemberSet=MemberSet(Size=2 Member(Id=1, Timestamp=2017-11-14 14:13:19.81, Address=172.17.0.3:8150, MachineId=20222, Location=site:,rack:4500a,machine:40e89ba7487c,process:24,member:storage, Role=sandbox_cache) Member(Id=2, Timestamp=2017-11-14 14:13:50.376, Address=172.17.0.2:9155, MachineId=22297, Location=site:,rack:4500a,machine:f0ace732de72,process:23,member:proxy, Role=sandbox_proxy) ) MemberId|ServiceVersion|ServiceJoined|MemberState 1|3.7.1|2017-11-14 14:13:19.81|JOINED, 2|3.7.1|2017-11-14 14:13:50.738|JOINED 

我有caching节点的WKA端口映射到主机,以及代理节点的代理端口:

 40e89ba7487c coh_storage "/usr/local/cohere..." About an hour ago Up About an hour 0.0.0.0:8150->8150/tcp, 0.0.0.0:8151->8151/udp coh-storage f0ace732de72 coh_proxy "/usr/local/cohere..." About an hour ago Up About an hour 0.0.0.0:10099->10099/tcp coh-proxy 

注意:存储节点映射8151 / udp的原因是因为我们启用了自动增量选项,我发现存储节点在容器内正在监听端口。

我可以看到主机上可用的端口,可以telnet到他们,所以我不认为这个问题是networking相关的:

 > netstat -an | grep 8150 tcp6 0 0 ::1.8150 *.* LISTEN tcp4 0 0 *.8150 *.* LISTEN > telnet 127.0.0.1 8150 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 

问题是我们有2个应用程序,1个连接到存储节点,1个连接到代理节点(通过Coherence Extend)。 后者完美的工作,但前者不。 应用程序无法连接到存储节点,而是尝试形成自己的群集:

 2017-11-14 07:57:59 ZPK=[,,] - DEBUG [Logger@20298357 3.7.1.9] Coherence - 2017-11-14 07:57:59.971/20.505 Oracle Coherence GE 3.7.1.9 <D4> (thread=RMI TCP Connection(2)-127.0.0.1, member=n/a): TCMP bound to /10.1.XX:8088 using SystemSocketProvider 2017-11-14 07:58:30 ZPK=[,,] - WARN [Logger@20298357 3.7.1.9] Coherence - 2017-11-14 07:58:30.746/51.282 Oracle Coherence GE 3.7.1.9 <Warning> (thread=Cluster, member=n/a): This Member(Id=0, Timestamp=2017-11-14 07:57:59.998, Address=10.1.XX:8088, MachineId=43279, Location=site:,process:59679, Role=Who-am-I) has been attempting to join the cluster using WKA list [/127.0.0.1:8150] for 30 seconds without success; this could indicate a mis-configured WKA, or it may simply be the result of a busy cluster or active failover. 2017-11-14 07:58:30 ZPK=[,,] - WARN [Logger@20298357 3.7.1.9] Coherence - 2017-11-14 07:58:30.746/51.282 Oracle Coherence GE 3.7.1.9 <Warning> (thread=Cluster, member=n/a): Delaying formation of a new cluster; waiting for well-known nodes to respond 

这是应用程序用于连接到caching节点的tangosol覆盖文件:

 <coherence> <cluster-config> <member-identity> <cluster-name system-property="tangosol.coherence.cluster">sandbox</cluster-name> <role-name system-property="environment.name">Who-am-I</role-name> </member-identity> <unicast-listener> <well-known-addresses> <socket-address id="1"> <address>127.0.0.1</address> <port>8150</port> </socket-address> </well-known-addresses> </unicast-listener> </cluster-config> <configurable-cache-factory-config> <class-name>com.oracle.coherence.environment.extensible.ExtensibleEnvironment</class-name> <init-params> <init-param> <param-type>java.lang.String</param-type> <param-value system-property="tangosol.coherence.cacheconfig">cache-config.xml</param-value> </init-param> </init-params> </configurable-cache-factory-config> <management-config> <managed-nodes>all</managed-nodes> <allow-remote-management>true</allow-remote-management> </management-config> <logging-config> <destination>log4j</destination> <severity-level system-property="tangosol.coherence.log.level">9</severity-level> </logging-config> </coherence> 

Interesting Posts