From: Ray Olszewski Subject: Re: synchronising two machines Date: Fri, 11 Apr 2003 08:32:34 -0700 Sender: linux-newbie-owner@vger.kernel.org Message-ID: <5.1.0.14.1.20030411081015.01ea54a8@celine> References: <1050051885.3493.16.camel@zebra.vil.ite.mee.com> Mime-Version: 1.0 Return-path: In-Reply-To: <1050051885.3493.16.camel@zebra.vil.ite.mee.com> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit To: Paul Furness , linux-newbie@vger.kernel.org First, there are two distinct issues you need to address: (1) Keeping "system" content in sync. (2) Keeping local content in sync. (1) This part involves applying security patches and doing other updating of the binaries your distro (Red Hat? I forget) supplies ... the equivalent of Debian's "apt-get update/upgrade" system. For this part, since only two hosts are involved, I would suggest not trying to sync in any automated way. Just run your distro's updater on both machines at the same time. Possibly set them up to use a Squid cache to avoid duplicate downloads. A properly designed updating system should know enough to refrain from replacing locally-edited config files with new default versions. (2) The best approach here turns on three questions: A. How closely do the two machines need to be sync'd? (How rapidly does the served content change?) Would an overnight sync be enough, or do you need minute-to-minute updates? Or somewhere (where?) in between? B. Is the need to sync *really* 1-way, as you seem to be saying? Or is it 2-way, as the "The idea is that if people find X1 is slow and busy they can use X2" comment seems to imply? This interacts with #1, of course, the core question being whether connected users themselves make changes that need to be propagated to the other server. C. How fast are the machines, including communication between them? How much of their resources can they spend on synchronizing without overburdening them? Offhand, I'd say your choices are rsync or a custom script (run through cron, say). Using slogin (or scp) rather than rlogin would help address the security concerns with automated root logins. But if you run the updater on X2 (the slave), it only needs *read* access to root-owned files on X1, so you should be able to login to X1 as a less-privileged user. Only a few files (such as /etc/shadow) then present special problems, and they might be best handles on a case-by-case basis. But the real solution, I think, is to limit what the automatic updater does so it updates only less-privileged files, rather than "almost everything". Without a better understanding of what this server pair does, I can't really suggest anything more specific. At 10:04 AM 4/11/2003 +0100, Paul Furness wrote: >Hi. > >Can anyone suggest a reliable yet simple way of synchronising two >identical linux servers? > >I have a server (let's call it X1) which is serving desktops out to >multiple clients using XDMCP. I then have a second server with identical >hardware (X2) which does the same job. The idea is that if people find >X1 is slow and busy they can use X2, and also if X1 fails then X2 is >still there. > >I want to duplicate everything between the two machines except stuff >which has to be unique - network settings being the obvious. During >building, this is easy; I have built X1, and then connect the hard disk >from X2 into X1 and use dd to copy the image across. Then I put the disk >back in X2, boot up and change the network settings and hostname. > >However, how do I keep them in sync after that? Ideally, I want to be >able to apply updates to only one of them (say X1) and have it >automatically propogate those changes to X2. > >rsync is a possible answer, I know, but I have two issues there: >A. I want it to update everything _except_ a few selected files, and >B. I need to run it as root, so to use rsync I'd have to open up rlogin >to root, which I'd rather not do if possible. > >Anyone got any ideas about what I should look at? > > >Oh, as an aside I _don't_ want a cluster, and I'm not trying to create a >single "virtual server". - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs