aspose file tools*
The moose likes Tomcat and the fly likes Tomcat replication question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat replication question" Watch "Tomcat replication question" New topic
Author

Tomcat replication question

Jeroen Meijer
Greenhorn

Joined: Jan 25, 2011
Posts: 5

Hi Friends,

I'm trying to setup Tomcat context replication which 3 tomcat nodes and an Apache loadbalancer

I've changed context.xml on each Tomcat instance to

<Context distributable="true" className="org.apache.catalina.ha.context.ReplicatedContext" >

And added the <distributable/> tag to web.xml

I've written a context listener to test if the replication worked



When I look at the Tomcat logs it seems that replication is setup correctly

[Tomcat A]
INFO: Deploying web application directory ContextSharing
25-jan-2011 9:51:33 org.apache.catalina.ha.session.DeltaManager start
INFO: Register manager /ContextSharing to cluster element Engine with name Catal
ina
25-jan-2011 9:51:33 org.apache.catalina.ha.session.DeltaManager start
INFO: Starting clustering manager at /ContextSharing
25-jan-2011 9:51:33 org.apache.catalina.ha.session.DeltaManager getAllClusterSes
sions
INFO: Manager [localhost#/ContextSharing]: skipping state transfer. No members a
ctive in cluster group. -> First tomcat to start, so no members exists
Context init -> Initial context startup, this is okay
init storage
SharedStorage init
Context init end


Everything seems okay

[Tomcat B]
INFO: Starting clustering manager at /ContextSharing
25-jan-2011 9:52:25 org.apache.catalina.ha.session.DeltaManager getAllClusterSes
sions
WARNING: Manager [localhost#/ContextSharing], requesting session state from org.
apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 1, 113}:4000,{192,
168, 1, 113},4000, alive=54015,id={-72 113 40 -25 -51 -71 73 -49 -120 -108 47 8
6 82 -9 53 -17 }, payload={}, command={}, domain={}, ]. This operation will time
out if no session state has been received within 60 seconds.
25-jan-2011 9:52:25 org.apache.catalina.ha.session.DeltaManager waitForSendAllSe
ssions
INFO: Manager [localhost#/ContextSharing]; session state send at 25-1-11 9:52 re
ceived in 109 ms.
Context init
init storage -> What's this?! This should have been done already by Tomcat A
SharedStorage init
Context init end
Jeroen Meijer
Greenhorn

Joined: Jan 25, 2011
Posts: 5

What am I missing?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

Are you sure that's a problem? If I have 3 program using shared storage and I'm not meticulous about my wording, I might use the work "init" to mean "setting up for and connecting to shared storage" as opposed to "setting up and formatting shared storage".


Customer surveys are for companies who didn't pay proper attention to begin with.
Jeroen Meijer
Greenhorn

Joined: Jan 25, 2011
Posts: 5

??
I'm sorry for my English as it is not my native language.

I solved the problem: I forgot to implement Serializable
Georges Salameh
Greenhorn

Joined: Jun 15, 2011
Posts: 4
I want to ask you which tomcat version are you using? and what exactly was the error? i know that it was serializable but where it needs to be added?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat replication question
 
Similar Threads
Tomcat and apache configuration in debian
Tomcat 6 Cluster Woes
My example with ServletContextListener and ServletContextAttrib.
Trouble restarting Tomcat 6.0.30 with Eclipse
tomcat cross cluster communication problems