HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Tips/Tricks/Mods (
-   -   Setting up a hot backup machine (

nabcoengineer 13th March 2009 22:32

Setting up a hot backup machine
Hi all. I hope this question has not been asked before.
I have a WEB server running on Ubuntu 8.1 server with ISPConfig, Mysql, PHP5 and I want to set up a separate machine as a hot backup so I can just unplug the main machine, change the IP on the backup machine and get the web sites back up and running in case of a catastrophic failure of the main system. I do have a mirror and a nightly backup of databases and web sites but this does not help if the machine itself huffs.
My question is this, what files and directories do I have to rsync to the backup to make everything work. I figure I need all of the /var/www stuff and all the mysql databases and the /root/ispconfig stuff but what else is there. I have tried so much now that I have to rebuild the backup machine from scratch.:(
Or... Is there an automated program that will handle this. I can connect the two machines together with a crossover ethernet cable cable to speed things up and not load down the network so it does not matter how much I have to copy.
Thanks in advance.

falko 14th March 2009 14:22

This should give xou the idea what files you have to sync:
For the MySQL database, I'd set up database replication.

nabcoengineer 18th March 2009 23:08

Thanks but
Thanks for the link but that is not exactly what I had in mind.
I want to, somehow, create a 'hot' backup that is always kept up to date with the master server. I guess what I really want is a machine mirror.

falko 19th March 2009 18:08

That will be difficult because of the different IP addresses. The IP addresses are used in some configuration files (e.g. the Apache configuration), so you'd have to somehow change the IP addresses on the mirror, and then there's the problem of the DNS records...

nabcoengineer 19th March 2009 21:29

How about this idea
If I had 2 nics in the both machines, set one up as and the other as 24.172.***.*** and on the other machine I set the first nic up as and the second the same as the first machine. I connect the two machines via a flip cable on the 192.168 cards and do the copying through the local cards. That way all I would have to do is swap the cable on the external card from the first machine to the second machine if the first machine went down and the IP would be the same.
errrr, I think that would work?? :rolleyes:

falko 20th March 2009 14:37

That could work. :)

nabcoengineer 20th March 2009 20:59

It works in a way
Well I followed your instructions, falko, and I have a backup running. All I have to do now is change the interfaces file and the hosts file to reflect the IP address on the backup machine, restart the networking and bam! it works. I can make a backup every day with cron but what I really want is a continuous mirror. I will let you all know if I figure it out.
Thanks for the help.

falko 21st March 2009 22:03

I'd set up a cron job for rsync that runs every 5 minutes. rsync will copy only files that are new, have been modified or deleted, so this will not cause much traffic.

trexen 8th April 2009 10:52


Plz if you have the time, make a HowTo document on how you did it.

tanx, rgds

trexen 8th April 2009 14:30

Nice, do you have any script(s) to share

how do you do whit /etcpasswd and /etc/shadow files in rsync ?
i got error it tells med that the file is in use when try to sync over these files.

//Marcus :)

Is this what you talking about ?

All times are GMT +2. The time now is 02:01.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.