Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: bakedjake

Message Too Old, No Replies

Need help with a rsync script

     
7:27 pm on Dec 4, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:June 24, 2005
posts:446
votes: 0


Here's my problem... I have a site on a load balanced system that splits requests to the site half and half to server 1 and server 2. My problem is that I have a client who edits a page (/sell/index.html) with a wysiwyg editor that. The problem is the client could either be editing the file on server 1 or server 2. So when viewer looked at the file the client modified, there would be a 50% chance they would be looking at an out of date file.

What I was thinking was that I would setup an rsync job in my cron files, to sync updates for this file between servers, so I wouldn't have this problem. Does anybody know if this would work, and if so, how I could implement this?

5:56 am on Dec 21, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 27, 2001
posts:784
votes: 0


This isn't straightforward as you don't know which server you should be rsyncing from and which to! But there may not even be a right answer... What happens if your user does one edit on server1 and then logs on an hour later and does another edit on server2?

You really need to find a better system. Either the two servers should share common storage, or you need a staging server of some kind. Having changes loaded to a random server in a load balancing set is just asking for trouble.