Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Iam using 2 Redhat linux 5.8 servers with a Tomcat application, I run a cronjob for directory replication from A server to B server with rsync. Now the problem is i need to execute this cronjob when the B server directory modified or A server modified.
Last edited by shaik_rafi2009; 12-29-2012 at 04:00 AM.
From A and B which is your master ? You should run the cronjob in the master server, which is easy to detect the modification and then run rsync to replicate. But you can run the cronjob in any system as the cronjob runs at particular interval and your cron script should be modified to work like that.
And if you are trying to do distributed servers on the cheap, then use a filesystem (gluster) to do that instead.
You can't have two master file servers and use rsync to distribute the modifications... No matter what you do, one or the other will delete/overwrite files you don't want destroyed. These are known race conditions that can't be easily fixed.
One of the problems with inotify is that it doesn't scale well. It is designed to watch single files/single directories. When you try to add an entire filesystem, you have to have it watch every single file and directory in the filesystem. And that just doesn't work well.
That is why I recommend using a distributed filesystem, and one that is designed for that.
The major problem is trying use parallel distributed use - inotify cannot cover race conditions. It wasn't designed for that.
I recommend gluster for its ease of configuration though I haven't used it myself (single server system). I have used luster which it is based on. Luster uses a master/slave metadata server to resolve race conditions. The actual data is stored/replicated among multiple servers. When a luster based storage cluster boots, each node joing the group becomes a slave - the startup node (first one up I think) becomes the designated master.
Last edited by jpollard; 12-31-2012 at 11:03 AM.
Reason: fixing paragraphing error.