[K12OSN] RSYNC Question

Paul Davison pauldavison at psps.com
Thu Mar 11 08:40:03 UTC 2004


Jim Kronebusch wrote:

> I have seen some stuff referring to rsync with backing up servers.  Can 
> anyone tell me how this works?  Can I use this to make an exact copy of 
> my running production server to a backup server of either equal or 
> lesser hardware.  Idea being that upon hardware failure of the 
> production server I would have an up to date backup (or possibly only 
> 24hrs behind) to swap in and run as a temporary production server until 
> the main hardware was repaired.  Let me know if this is feasible (maybe 
> I need identical hardware) and if so where to start (what commands to 
> issue).  Ideally I would like to have the two machines running a 
> scheduled periodic backup that was automatic and did not require any 
> manual intervention.
>  
> Thanks

This is perhaps a question that is too large to be handled in one email, 
but I can probably shed some light.

The common term for this setup is a 'hot spare', in a totally hands off 
redundant system, there would be a 'heartbeat' running between the main 
server and the spare. if the main servers heartbeat stops, the second 
server essentially changes its IP address and becomes the new main 
server.  This is probably a little more involved than you really 
require.  As long as you don't mind doing a little bit of 'hands on' 
work to bring up your spare. The same result can be obtained using some 
forethought,'cron' and 'rsync'.

If you have a second server which can handle all of the same tasks (or 
some subset of critical tasks)you can set that server up with the same 
services enabled and ready to go.  This is where 'rsync' and 'cron' come 
in to play.  Set up an 'rsync' command to synchronize the critical data 
from the main server (home directories, mail spool, web content etc) to 
the spare server.  Use 'cron' to run the 'rsync' command on a regular 
basis (once a day, once an hour, depends on your needs). this will keep 
the data up to date on the spare server.  Then on the spare server I 
would create a 'swapserver' script to change the IP address to that of 
the main server, and enable the services required.

Once all that is in place, then all you would need to do to swap in the 
server in the event of a failure would be to log in to the spare and run 
the 'swapserver' script.

You could do some googleing for terms like 'hot spare' 'heartbeat' and 
'disaster recovery'  for some additional info.

Paul Davison





More information about the K12OSN mailing list