无法让Hazelcast在Docker Swarm中工作

我一直在试图让Hazelcast在一个运行Amazon EC2的Docker群体中成为一个Tomcat会话复制器(因为Amazon ELB的粘性会话设置拒绝工作,如果有人按照我的另一个问题:P)试图使用Hazelcast Tomcat会话pipe理器( https://github.com/hazelcast/hazelcast-tomcat-sessionmanager )。

我有3个EC2节点,在其上运行Docker Swarm(使用Docker for AWS),并在每个节点上运行一个Tomcat实例。

我不能让每个Tomcat实例上的Hazelcast相互交谈。 多播根本不起作用,即使所有设置都正确,TCP / IP也会导致持续的拒绝连接。

这是tomcat在尝试使用TCP / IP并手动指定IP地址时的错误输出:

25-Jul-2017 16:41:13.934 INFO [main] com.hazelcast.instance.DefaultAddressPicker.null [LOCAL] [dev] [3.8.3] Interfaces is disabled, trying to pick one address from TCP-IP config addresses: [172.31.23.183, 172.31.8.28, 172.31.37.34] 25-Jul-2017 16:41:13.934 INFO [main] com.hazelcast.instance.DefaultAddressPicker.null [LOCAL] [dev] [3.8.3] Prefer IPv4 stack is true. 25-Jul-2017 16:41:13.936 WARNING [main] com.hazelcast.instance.DefaultAddressPicker.null [LOCAL] [dev] [3.8.3] Could not find a matching address to start with! Picking one of non-loopback addresses. 25-Jul-2017 16:41:13.939 INFO [main] com.hazelcast.instance.DefaultAddressPicker.null [LOCAL] [dev] [3.8.3] Picked [10.255.0.5]:5701, using socket ServerSocket[addr=/0.0.0.0,localport=5701], bind any local is true 25-Jul-2017 16:41:13.949 INFO [main] com.hazelcast.system.null [10.255.0.5]:5701 [dev] [3.8.3] Hazelcast 3.8.3 (20170704 - 10e1449) starting at [10.255.0.5]:5701 25-Jul-2017 16:41:13.949 INFO [main] com.hazelcast.system.null [10.255.0.5]:5701 [dev] [3.8.3] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved. 25-Jul-2017 16:41:13.949 INFO [main] com.hazelcast.system.null [10.255.0.5]:5701 [dev] [3.8.3] Configured Hazelcast Serialization version : 1 25-Jul-2017 16:41:14.187 INFO [main] com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator.null [10.255.0.5]:5701 [dev] [3.8.3] Backpressure is disabled 25-Jul-2017 16:41:14.702 INFO [main] com.hazelcast.instance.Node.null [10.255.0.5]:5701 [dev] [3.8.3] Creating TcpIpJoiner 25-Jul-2017 16:41:14.865 INFO [main] com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.null [10.255.0.5]:5701 [dev] [3.8.3] Starting 2 partition threads 25-Jul-2017 16:41:14.866 INFO [main] com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.null [10.255.0.5]:5701 [dev] [3.8.3] Starting 3 generic threads (1 dedicated for priority tasks) 25-Jul-2017 16:41:14.877 INFO [main] com.hazelcast.core.LifecycleService.null [10.255.0.5]:5701 [dev] [3.8.3] [10.255.0.5]:5701 is STARTING 25-Jul-2017 16:41:14.914 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-3] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.8.28:5702, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.915 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-3] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.8.28:5702. Reason: SocketException[Connection refused to address /172.31.8.28:5702] 25-Jul-2017 16:41:14.915 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-3] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.8.28]:5702 is added to the blacklist. 25-Jul-2017 16:41:14.916 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-3] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.37.34:5701, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.917 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-4] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.23.183:5701, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.917 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.8.28:5701, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.917 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.8.28:5701. Reason: SocketException[Connection refused to address /172.31.8.28:5701] 25-Jul-2017 16:41:14.917 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.8.28]:5701 is added to the blacklist. 25-Jul-2017 16:41:14.918 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-3] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.37.34:5701. Reason: SocketException[Connection refused to address /172.31.37.34:5701] 25-Jul-2017 16:41:14.918 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-3] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.37.34]:5701 is added to the blacklist. 25-Jul-2017 16:41:14.918 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-4] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.23.183:5701. Reason: SocketException[Connection refused to address /172.31.23.183:5701] 25-Jul-2017 16:41:14.918 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-4] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.23.183]:5701 is added to the blacklist. 25-Jul-2017 16:41:14.918 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-2] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.8.28:5703, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.919 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-2] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.8.28:5703. Reason: SocketException[Connection refused to address /172.31.8.28:5703] 25-Jul-2017 16:41:14.919 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-2] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.8.28]:5703 is added to the blacklist. 25-Jul-2017 16:41:14.921 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.23.183:5702, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.922 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.23.183:5702. Reason: SocketException[Connection refused to address /172.31.23.183:5702] 25-Jul-2017 16:41:14.922 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.23.183]:5702 is added to the blacklist. 25-Jul-2017 16:41:14.923 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.37.34:5703, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.924 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.37.34:5703. Reason: SocketException[Connection refused to address /172.31.37.34:5703] 25-Jul-2017 16:41:14.924 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.37.34]:5703 is added to the blacklist. 25-Jul-2017 16:41:14.925 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.23.183:5703, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.926 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.23.183:5703. Reason: SocketException[Connection refused to address /172.31.23.183:5703] 25-Jul-2017 16:41:14.926 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-1] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.23.183]:5703 is added to the blacklist. 25-Jul-2017 16:41:14.930 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-8] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Connecting to /172.31.37.34:5702, timeout: 0, bind-any: true 25-Jul-2017 16:41:14.932 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-8] com.hazelcast.nio.tcp.InitConnectionTask.null [10.255.0.5]:5701 [dev] [3.8.3] Could not connect to: /172.31.37.34:5702. Reason: SocketException[Connection refused to address /172.31.37.34:5702] 25-Jul-2017 16:41:14.932 INFO [hz.SESSION-REPLICATION-INSTANCE.cached.thread-8] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] [172.31.37.34]:5702 is added to the blacklist. 25-Jul-2017 16:41:15.930 INFO [main] com.hazelcast.system.null [10.255.0.5]:5701 [dev] [3.8.3] Cluster version set to 3.8 25-Jul-2017 16:41:15.931 INFO [main] com.hazelcast.cluster.impl.TcpIpJoiner.null [10.255.0.5]:5701 [dev] [3.8.3] Members [1] { Member [10.255.0.5]:5701 - 7995c688-0236-49b2-9894-53873cf5dc49 this } 25-Jul-2017 16:41:15.955 INFO [main] com.hazelcast.core.LifecycleService.null [10.255.0.5]:5701 [dev] [3.8.3] [10.255.0.5]:5701 is STARTED