hi, thanks for your input..

1. switching that backend is apparently not an option, i wouldn't have asked 
with respect to a non-clusterable data-backend
2. it wouldn't be that two request update one piece of data, but it would be 
that the first cluster member that receives 
   a POST request, posts that request also to other members, these then simply 
handle this POST request. Since every 
   application has it's own datadirectory every member would write into it's 
own datadirectory, that's why the requests
   need to be forwarded to all members of the cluster.
3. these three tomcats on one machine are for testing purposes only - real 
world would go on different physical machines.

image you have a simple text file in the WEB-INF directory of a webapp named 
ClusterApp. this ClusterApp is deployed 
on three tomcats in a cluster. now comes a POST request, that updates the text 
file (adds one line to it).
now of course i need to synchronize the text file on all tomcats in the cluster.

in my opinion there are only a few options to achieve this :
1. rsync the file, which is kind of hard, since i have a load balancer and 
don't know exactly which member answers the request, there are 
   to many insecurities
2. check all incoming requests for HTTP POST, if the request is a POST the send 
it simply to all members of the cluster.

honestly i can hardly imagine that i'm the first to come across this usecase...

any help really appreciated..
wkr turnguard.com/turnguard

----- Original Message -----
From: "André Warnier" <a...@ice-sa.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, April 6, 2011 9:43:02 PM
Subject: Re: TomcatCluster data replication

Jürgen Jakobitsch wrote:
> hi,
> i'm in need of data replication in a tomcat-cluster.
> i set up a tomcat cluster of three tomcats on a single machine with a apache 
> (mod_jk) front that does the load balacing.
> everything works absolutely charming for reading requests, my trouble start 
> with data input.
> what i'm trying to achieve is that if i submit data with a html form, the 
> storage on all cluster members needs to be updated.
> i'm using an openrdf's sesame triple store which locks it's data directory so 
> i can't simply use a single shared directory
> in my application.
> what i have in mind, after first readings, is some sort of clustervalve that 
> checks, if a request is a POST request and if
> yes, sends this request (which updates the repository in the back) to all 
> members of the cluster.
> so here would be my questions :
> 1. is there a standard way of doing something like (which a not-clusterable 
> data-backend)


> 2. is the thing with the clustervalve in fact the correct starting point

Probably not.

> any help or pointer to the right direction greatly appreciated
I'm not saying that it would not be possible to do this.  And I have no idea 
what a 
"openrdf's sesame triple store" is.
But what you describe sounds more like something that should be handled at the 
level of 
the application which processes the POST.  It is the application which should 
arrange to 
update the nn back-end data stores at the same time.  Of course that introduces 
interesting issues of locking and synchronisation, in case two 
quasi-simultaneous requests 
handled by two separate tomcats try to update the same piece of data in each of 

Now just by curiosity, what is the real-world point of this setup, considering 
that your 3 
tomcats are running on the same host ?
Why not have a single Tomcat with 3 times more resources, to handle all the 
requests ?

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

punkt. netServices
Jürgen Jakobitsch

Lerchenfelder Gürtel 43 Top 5/2
A - 1160 Wien
Tel.: 01 / 897 41 22 - 29
Fax: 01 / 897 41 22 - 22

netServices http://www.punkt.at

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to