Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Load Balanced High-Availability Web Cluster with 3 nodes. Therefore all 3 nodes must have the identical websites otherwise there will be inconsitencies with what appears on the browser with each http request. To keep the web sites consitent on all web servers I originally used rsync in a circular loop which caused many problems when files were created, deleted, or modified on a particular web server node. As you can imagine some changes were overwritten since rsync is one-way mirroring software. To make matters worse in order to get rsync to run automatically I had set up cronjobs to run every 5 minutes. Can you imagine someone uploading a file to one of these nodes and having to wait up to 10 minutes for them to replicate to the other nodes, and that is if it wasn't overwritten/deleted by the rsync process itself.
So I started to experiment with Unison. It achieves the two-way mirroring I need, but not the continuos part. It has a --repeat option that can be used for continuos replication but it does not operate in the background so it locks up your terminal window, for servers that have no GUI installed and administered remotely would eventually have the problem that the connection will time out not to mention the security risk of leaving a remote terminal window open (CTRL-C breaks the command and grants access to the shell ).
As a small band-aid solution I have created cronjobs to run unison on one of the nodes as it syncs with the other two every minute (Hub and Spoke topology as recommended by Unison docs). But still changes may take as long as 2 minutes to propagate to all nodes. Recently Unison has cease to exist in development and there is no support for it.
What I need is continuos two-way mirroring for these three nodes so that files on the websites are consitently the same. Either a daemon or background process that can achieve this will be greatly helpful. I was looking into Pavuk but the commands are horribly long and when I sent a message on their mailing list about it having two-way mirroring capabilities I received no reply, after 3 weeks!
All machines (3 nodes + 2 load-balancers):
Ubuntu 6.06 Server (no X-Windows/GUI)
Apache 2
Mysql 5
Php 5
Any suggestions or help would be greatly appreciated. Thanks for your support.
1) Tried & at the end of the unison command with the -repeat 002 option, it fails miserably. Fills the terminal window with all kinds of output even though I have also used -silent options as well. Did not work for unison. Maybe there is another way to get unison to work constently.
2) how to forge has some great stuff but all they recommend for replication among a web cluster is rsync. Which as I said before only uses one way synchronization, so it is limited to a max of two nodes, and I have three.
3) NFS I don't know much about I will look into it, but isn't that used for network shares as far as a file server with one-way remote replication?
Thanks to all who have tried to help, looking for simple replication solution. I know there is one out there. Feedback is greatly appreciated.
Also redirect output of unison command to some file, so you can check for conflicts.
Code:
Code:
unison ... >> /tmp/logfile
Don't forget to delete the log file periodically.
I tried the redirection to a > /dev/null and the terminal still gets filled up with garbage on all the conflicts, which at this point are many. So >> to a log file will probably do the same although I will try it for kicks this week.
slimm609 wrote:
Quote:
add an entry to rc.local
/path/to/file -repeat 002
and it will start when the system starts
what exactly is
Quote:
/path/to/file
I think you are refering to the unison command but I am not really sure.
Also, I solved all conflicts reported into the logfile before actually starting the repetition which can be troubleshooted by simply removing -repeat 002 and the final & from the command. Then when I was error free I went ahead and went to production with the command. Thanks everyone...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.