[opencms-dev] using rsync to cluster opencms

M Butcher mbutcher at grcomputing.net
Thu Jun 10 03:04:00 CEST 2004


Cory,

I've been trying to come up with a decent way of doing this without 
disabling the FlexCache. All of the solutions I've seen thus far have 
required turning off the FlexCache for exactly the reason you mentioned.

However, when I was reading your email, and idea struck me. I'm more or 
less thinking out loud, here. I haven't actually implemented this.

For the sake of clarity, let's state the problem:

Let's say we have two servers: Server A (the "master") and Server B (a 
replica). When the content on Server A is ready, we want its online 
project to be replicated to Server B. Then, we want Server B to pick of 
the changes right away -- that is, to load the content and clear its cache.

Roughly speaking, here are the steps involved:

1) Server A publishes content to Online project
2) Server A exports content (or preparse content for transmission to 
ServerB)
3) Server A sends the content to Server B
4) Server B loads the content
5) Server B clears its cache

Given that module, here are some ideas of how it could be implemented 
(with numbers corresponding to steps above):

1) For the first step, simply publishing a project should suffice.
2) Add an event handler to listen for a publish event. When one occurs, 
export the content (viz. Database->export, not static export). In this 
case, the result would be a single zip file.

An alternative (which would be somewhat more daring) would be to use the 
FS synchronization feature. Synchronization copies the VFS to the 
underlying file system. rsync would benefit from this, since it diffs 
files before sending them. But otherwise it could add to the
complexity.

3) rsync would be one way of doing this, or you could try something else 
(FTP, HTTP/WebDAV)

4) Server B would then have to have some process running -- maybe a 
Scheduled Task running every five or ten minutes that would look in a 
pre-set location for an update file. If it finds one, it imports it.

5) When the scheduled task finishes, it clears the FlexCache.

Anyway, just thinking out loud.

Matt


Cory Hubert wrote:
> 	Hey.  I am looking for some suggestions/implementations on using rsync for
> opencms in a clustered/load balanced environment.
> 
> 	Currently the solution I am working on does not use exports.   The main
> problem is that if someone publishes on one machine the published changes do
> not show up on the other machines until the cache expires on the other
> machines.  Because of other dependencies we need the published changes to
> replicated to the other machines ASAP.
> 
> 	I did a few searches on the list and saw people were using rsync.   What
> directories are being rsynced?  The entire webapp directory?  The
> tomcat/work directory?
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list