Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I have two web servers. One is active and one is in reserve. I keep the user data (web pages) in sync by running rsync every 10 minutes or so. This copies any changes from the active machine to the reserve machine. But, it's slow, only gets changes every 10 minutes, bogs down the disk, does strange things to files that are changing during the rsync process etc...
I want something that will automatically copy any changes from the active server to the reserve server as they are made. IE I hit 'save' on the active server, it copies the file to the reserve server. Simple!
I've been looking around and I see GFS which is really vastly more complicated than I need. I'm happy with read-only access on the reserve host, so I don't need distributed lock management.
I could theoretically implement this by setting inotify watchers on every file and running an SCP or rsync command when a file gets saved. So, it can't be that hard.
I do not need a true networked file system, as in something I mount over the network. I just want something to keep my disks in sync.
Either other people have had this problem and there's a solution or I'm thinking about this the wrong way and there's a solution.
I tried DRBD, but you can't read the contents on the inactive server. I need to be able to check the inactive server to make sure it's working and if I can't see the user data that I want to mirror, I can't test it. DRBD can do a thing called 'dual primary' where you can actually mount it on both machines, but it's the filesystem, not the block device, that tells the kernel when a file has changed, so changes on the active host don't appear on the inactive host and things can get very weird. If I wanted to run GFS, I could make it work, but that just seems like a crazy idea when I don't need both ends of the connection to be writable.