0
votes

When trying to connect to the Hazelcast server, my test program fails with "Failed to authenticate connection" after approximately 1 minute - see messages below.

On the server side, I use the sample "hazelcast.xml" file delivered with hazelcast 3.11, and I only changed 2 entries:

  1. disabled multicast
  2. enabled tcp/ip

On the client side, I use an almost empty hazelcast 4.1 client config XML file. Only the network address of the (only) server node "localhost" is specified.

This kind of configuration works fine if both, client and server, are either Hazelcast version 3 or version 4.

Any ideas what might be the problem here?

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

1 Answers

3
votes

The client protocol changed between 3.x and 4.x versions of Hazelcast, so you cannot connect a 3.x client to a 4.x server or vice-versa.

The cluster member protocol was also changed, meaning you cannot have a cluster of mixed 3.x and 4.x nodes.

Further info can be found here