当尝试连接到hazelcast服务器时,我的测试程序在大约1分钟后以“验证连接失败”失败-请参阅下面的消息。
在服务器端,我使用了hazelcast 3.11附带的示例“hazelcast.xml”文件,只更改了2个条目:
禁用的多播
已启用tcp/ip
在客户端,我使用了一个几乎为空的hazelcast 4.1客户机配置xml文件。仅指定(仅)服务器节点“localhost”的网络地址。
如果客户端和服务器都是hazelcast版本3或版本4,这种配置就可以正常工作。
你知道这里有什么问题吗?
Dez 01, 2020 3:59:36 PM com.hazelcast.client.impl.spi.ClientInvocationService
INFORMATION: hz.client_1 [dev] [4.1] Running with 2 response threads, dynamic=true
Dez 01, 2020 3:59:36 PM com.hazelcast.core.LifecycleService
INFORMATION: hz.client_1 [dev] [4.1] HazelcastClient 4.1 (20201104 - 2a1a477) is STARTING
Dez 01, 2020 3:59:36 PM com.hazelcast.core.LifecycleService
INFORMATION: hz.client_1 [dev] [4.1] HazelcastClient 4.1 (20201104 - 2a1a477) is STARTED
Dez 01, 2020 3:59:37 PM com.hazelcast.client.impl.connection.ClientConnectionManager
INFORMATION: hz.client_1 [dev] [4.1] Trying to connect to cluster: dev
Dez 01, 2020 3:59:37 PM com.hazelcast.client.impl.connection.ClientConnectionManager
INFORMATION: hz.client_1 [dev] [4.1] Trying to connect to [localhost]:5701
Dez 01, 2020 4:00:37 PM com.hazelcast.client.impl.connection.tcp.TcpClientConnection
WARNUNG: hz.client_1 [dev] [4.1] ClientConnection{alive=false, connectionId=1, channel=NioChannel{/127.0.0.1:53189->localhost/127.0.0.1:5701}, remoteAddress=null, lastReadTime=2020-12-01 15:59:37.239, lastWriteTime=2020-12-01 15:59:37.270, closedTime=2020-12-01 16:00:37.286, connected server version=null} closed. Reason: Failed to authenticate connection
java.util.concurrent.TimeoutException
at com.hazelcast.client.impl.spi.impl.ClientInvocationFuture.newTimeoutException(ClientInvocationFuture.java:63)
at com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:653)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.authenticateOnCluster(TcpClientConnectionManager.java:820)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.getOrConnect(TcpClientConnectionManager.java:585)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.connect(TcpClientConnectionManager.java:428)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.doConnectToCandidateCluster(TcpClientConnectionManager.java:456)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.doConnectToCluster(TcpClientConnectionManager.java:390)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.connectToCluster(TcpClientConnectionManager.java:351)
at com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager.start(TcpClientConnectionManager.java:301)
at com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl.start(HazelcastClientInstanceImpl.java:368)
at com.hazelcast.client.HazelcastClient.constructHazelcastClient(HazelcastClient.java:460)
at com.hazelcast.client.HazelcastClient.newHazelcastClientInternal(HazelcastClient.java:416)
at com.hazelcast.client.HazelcastClient.newHazelcastClient(HazelcastClient.java:136)
...
Dez 01, 2020 4:00:37 PM com.hazelcast.client.impl.connection.ClientConnectionManager
WARNUNG: hz.client_1 [dev] [4.1] Exception during initial connection to [localhost]:5701: com.hazelcast.core.HazelcastException: java.util.concurrent.TimeoutException
...
1条答案
按热度按时间lnxxn5zx1#
客户端协议在3.x和4.x版本的hazelcast之间发生了更改,因此无法将3.x客户端连接到4.x服务器,反之亦然。
群集成员协议也发生了更改,这意味着您不能拥有混合3.x和4.x节点的群集。
更多信息可以在这里找到