0

Tomcat session replication with Hazelcast:

https://github.com/hazelcast/hazelcast-tomcat-sessionmanager

Downloaded the hazelcast-5.3.0.zip, it has hazelcast-5.3.0.jar (16M), but it does not have hazelcast-all-5.3.0.jar.

Following the instruction for P2P.

added hazelcast-5.3.0.jar and hazelcast-tomcat9-sessionmanager-2.2.jar to tomcat/lib.

No hazelcast.xml.

server.xml

  <Listener className="com.hazelcast.session.P2PLifecycleListener" />

context.xml:

 <Manager className="com.hazelcast.session.HazelcastSessionManager" sticky="false"/>

When starting tomcat9 in kubernetes cluster, there are lots of errors like:

03-Jun-2023 21:26:31.863 WARNING [hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-1] com.hazelcast.internal.server.tcp.TcpServerConnection.null [10.1.1.2]:5701 [dev] [5.3.0] Connection[id=2, /10.1.1.2:40177->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=false, connectionType=NONE, planeIndex=-1] closed. Reason: Exception in Connection[id=2, /10.1.1.2:40177->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=true, connectionType=NONE, planeIndex=-1], thread=hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-1
        java.lang.IllegalStateException: Unknown protocol: J
                at com.hazelcast.internal.server.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:132)
                at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
                at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:383)
                at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:368)
                at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:294)
                at com.hazelcast.internal.networking.nio.NioThread.executeRun(NioThread.java:249)


03-Jun-2023 21:27:22.164 WARNING [hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-2] com.hazelcast.internal.server.tcp.TcpServerConnection.null [10.1.1.2]:5701 [dev] [5.3.0] Connection[id=102, /10.1.1.2:40583->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=false, connectionType=NONE, planeIndex=-1] closed. Reason: Exception in Connection[id=102, /10.1.1.2:40583->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=true, connectionType=NONE, planeIndex=-1], thread=hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-2
        java.lang.IllegalStateException: Unknown protocol: 1
                at com.hazelcast.internal.server.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:132)
                at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
                at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:383)
                at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:368)
                at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:294)
                at com.hazelcast.internal.networking.nio.NioThread.executeRun(NioThread.java:249)

Where is Protocol J/1 coming from?

com.hazelcast.internal.server.tcp.TcpServerConnection.null: null?

hazelcast.xml is required?

eastwater
  • 4,624
  • 9
  • 49
  • 118
  • Just a little note. 1. hazelcast-all.jar does not exist. The documentation of the project is a little old 2. There is a default xml file in the hazelcast-5.3.0.jar. The default xml is using multicast for discovery. It may not work in Kubernetes environment. I suggest you create your own XML or YAML file for configuration – Orçun Çolak Jun 07 '23 at 07:52

0 Answers0