P2P Hazelcast Session Replication for Tomcat6 Web Clustering

66 views
Skip to first unread message

vikram.p...@gmail.com

unread,
Oct 26, 2017, 7:39:58 PM10/26/17
to Hazelcast
I believe I am missing some configuration either on load balancing side or in tomcat, it would great if someone could help and provide the solution.

What am i trying to do?

1. Setup two tomcat instances with P2P Hazelcast session replication for tomcat6 by referring to this [guide][1]
2. I have placed the hazelcast-all-<version>.jar and hazelcast-tomcat<tomcatversion>-sessionmanager-<version>.jar in the folder $CATALINA_HOME/lib/
3. Updated the listener and the context configs as shown below
4. Updated Tomcat Failover and the jvmRoute Parameter as shown below
5. So far, i was able to bring up the tomcat instances which connect to each others hazelcast instances, I see that in the tomcat logs.
6. The users connects to the load balancer and are routed to the balancer members - no issues here.
7. But when I take one of the tomcat instance down to test failover and to make sure users who were connected to tom instance were able to continue to cat instance with the same session and without having to sign in again. But I believe the load balancer seems to be creating a new session and forces user to sign in again to establish a session with cat instance. I suspect it this but not sure.
8. Or are the sessions not being replicated and synced in both hazelcast instances?
9. Do we have a client where I could monitor hazelcast sessions?


I did refer to this [issue][2] which refers setting up hazelcast.sessionId instead of JSESSIONID but does not provide any specifics about how to.

Versions -

   
Apache Haus - 2.2.32 (for load balancing)
   
Hazelcast - 3.8.6
   
Java 8
   
Tomcat - 6.0.48
   
Session objects that need to be clustered are Serializable.
    stickysession
=JSESSIONID




Load Balancer Configuration
    
   

     
<Proxy balancer://mycluster>
        BalancerMember http://IPAddress1:8080/app/  route=tom
        BalancerMember http://IPAddress2:8080/app/  route=cat
        ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid
     
</Proxy>
       
        ProxyPass /app/ balancer://mycluster/
        ProxyPassReverse /app/ balancer://mycluster/




tom instance - server.xml

    <Listener className="com.hazelcast.session.P2PLifecycleListener"/>
   
<Engine name="Catalina" defaultHost="localhost"  jvmRoute="tom">


tom instance - context.xml

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


cat instance - server.xml

   
 <Listener className="com.hazelcast.session.P2PLifecycleListener"/>
   
<Engine name="Catalina" defaultHost="localhost"  jvmRoute="cat">


cat instance - context.xml

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



Emre Aydın

unread,
Oct 27, 2017, 5:45:43 AM10/27/17
to haze...@googlegroups.com
Hi Vikram,

I have answered your question on Stackoverflow - https://stackoverflow.com/a/46972102/2080975.

Emre

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/5aa57c04-01be-473f-95b4-9507f7ba94b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages