synchronizing a set of Linux boxes - Help

This is a discussion on synchronizing a set of Linux boxes - Help ; Hi. We have a lab with around 20 Linux (Fedora FC4) boxes. We would like these machines to be essentially identical. The idea is that updates would only be done on one machine, and that changes would migrate from this ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: synchronizing a set of Linux boxes

  1. synchronizing a set of Linux boxes

    Hi.

    We have a lab with around 20 Linux (Fedora FC4) boxes. We would like these
    machines to be essentially identical. The idea is that updates would only
    be done on one machine, and that changes would migrate from this machine to
    other machines. We do this via an rsync-based script (called sync-lab),
    which would run overnight, courtesy of cron.

    Of course:

    (1) The hostnames and IP addresses shouldn't be replicated.
    (2) We use autorpm to update the "source" machine only. We don't want to
    run autorpm on the other lab machines.
    (3) We don't want to mess with the log files on the other lab machines.

    So here's the sync-lab script:

    ------%<--%<--%<---cut here---%<--%<--%<----------------------------
    #!/bin/sh

    remoteMachines=/usr/local/adm/sync-lab/remoteMachines
    excludedFiles=/usr/local/adm/sync-lab/excludedFiles

    export RSYNC_RSH=/usr/bin/ssh
    for machine in `cat $remoteMachines`
    do
    rsync -ax --delete --exclude-from=$excludedFiles / $machine:/
    rsync -ax --delete /boot/ $machine:/boot/
    rsync -ax --delete /usr/local/ $machine:/usr/local/
    done
    ------%<--%<--%<---cut here---%<--%<--%<----------------------------

    The file "excludedFiles" contains the following:

    /etc/sysconfig/network
    /etc/sysconfig/network-scripts/ifcfg-eth0
    /etc/autorpm.d/autorpm.cron
    /var/spool/cron/root
    /var/log/*

    and "remoteMachines" contains the IP address of only one machine (while
    we're in "shakedown" mode).

    Here's the output of sync-lab:

    ---%<------%<------%<------%<--Cut-Here-%<------%<------%<------%<---
    rsync: delete_file: rmdir "/dev/shm" failed: Device or resource busy (16)
    rsync: delete_file: rmdir "/proc/tty" failed: Operation not permitted (1)
    rsync: delete_file: rmdir "/selinux/booleans" failed: Operation not
    permitted (1)
    rsync: delete_file: rmdir "/sys/power" failed: Operation not permitted (1)
    rsync: delete_file: rmdir "/var/lib/nfs/rpc_pipefs/statd" failed: Operation
    not permitted (1)
    rsync error: some files could not be transferred (code 23) at main.c(789)
    ---%<------%<------%<------%<--Cut-Here-%<------%<------%<------%<---

    Our problem: When the target machine was rebooted after running sync-lab,
    an X-windows login would hang. It would get the username and password, but
    nothing would happen after the login widget disappeared (i.e., we didn't
    get the usual GNOME stuff). I eventually had to reboot the target machine.

    However, after rebooting the target machine, everything seemed OK.

    Does anybody have an idea why this is happening? What should I change to
    fix the problem?

    Many thanks.

    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y?
    Net: agw@dsm.fordham.edu WWW
    Phone: Fordham U. (212) 636-6325, Columbia U. (212) 939-7060

  2. Re: synchronizing a set of Linux boxes

    On Mon, 07 Nov 2005 14:15:35 -0500, Art Werschulz wrote:

    > Hi.
    >
    > We have a lab with around 20 Linux (Fedora FC4) boxes. We would like
    > these machines to be essentially identical. The idea is that updates
    > would only be done on one machine, and that changes would migrate from
    > this machine to other machines. We do this via an rsync-based script
    > (called sync-lab), which would run overnight, courtesy of cron.
    >
    > Of course:
    >
    > (1) The hostnames and IP addresses shouldn't be replicated. (2) We use
    > autorpm to update the "source" machine only. We don't want to
    > run autorpm on the other lab machines.
    > (3) We don't want to mess with the log files on the other lab machines.
    >
    > So here's the sync-lab script:
    >
    > ------%<--%<--%<---cut here---%<--%<--%<----------------------------
    > #!/bin/sh
    >
    > remoteMachines=/usr/local/adm/sync-lab/remoteMachines
    > excludedFiles=/usr/local/adm/sync-lab/excludedFiles
    >
    > export RSYNC_RSH=/usr/bin/ssh
    > for machine in `cat $remoteMachines`
    > do
    > rsync -ax --delete --exclude-from=$excludedFiles / $machine:/ rsync
    > -ax --delete /boot/ $machine:/boot/ rsync -ax --delete /usr/local/
    > $machine:/usr/local/
    > done
    > ------%<--%<--%<---cut here---%<--%<--%<----------------------------
    >
    > The file "excludedFiles" contains the following:
    >
    > /etc/sysconfig/network
    > /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/autorpm.d/autorpm.cron
    > /var/spool/cron/root
    > /var/log/*
    >
    > and "remoteMachines" contains the IP address of only one machine (while
    > we're in "shakedown" mode).
    >
    > Here's the output of sync-lab:
    >
    > ---%<------%<------%<------%<--Cut-Here-%<------%<------%<------%<---
    > rsync: delete_file: rmdir "/dev/shm" failed: Device or resource busy
    > (16) rsync: delete_file: rmdir "/proc/tty" failed: Operation not
    > permitted (1) rsync: delete_file: rmdir "/selinux/booleans" failed:
    > Operation not
    > permitted (1)
    > rsync: delete_file: rmdir "/sys/power" failed: Operation not permitted
    > (1) rsync: delete_file: rmdir "/var/lib/nfs/rpc_pipefs/statd" failed:
    > Operation
    > not permitted (1)
    > rsync error: some files could not be transferred (code 23) at
    > main.c(789)
    > ---%<------%<------%<------%<--Cut-Here-%<------%<------%<------%<---
    >
    > Our problem: When the target machine was rebooted after running
    > sync-lab, an X-windows login would hang. It would get the username and
    > password, but nothing would happen after the login widget disappeared
    > (i.e., we didn't get the usual GNOME stuff). I eventually had to reboot
    > the target machine.
    >
    > However, after rebooting the target machine, everything seemed OK.
    >
    > Does anybody have an idea why this is happening? What should I change
    > to fix the problem?
    >
    > Many thanks.


    I use rsync in a cron job on a nightly basis. There are some things
    that you can't sync between machines! Unless the machines are completely
    identical (and even then there are problems), like same devices attached,
    same hardware, even hard disk partitioning can even be a factor!

    First, in this case, it doesn't seem to make sense that you're a trying
    sync devices between computers, like /dev/shm so that (the /dev
    directory) should be excluded. Second, it doesn't make sense to sync a
    virtual file system like proc. Proc is only created dynamically to
    communicate system state from the kernel to other programs. Don't ever
    sync it! Other files failed too but I can't see why with this information.

    --
    R. Scott Smith


+ Reply to Thread