Setting up a hot backup machine

Discussion in 'Tips/Tricks/Mods' started by nabcoengineer, Mar 13, 2009.

  1. nabcoengineer

    nabcoengineer New Member

    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.
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. nabcoengineer

    nabcoengineer New Member

    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.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    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...
     
  5. nabcoengineer

    nabcoengineer New Member

    How about this idea

    If I had 2 nics in the both machines, set one up as 192.168.1.181 and the other as 24.172.***.*** and on the other machine I set the first nic up as 192.168.1.182 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:
     
  6. falko

    falko Super Moderator Howtoforge Staff

    That could work. :)
     
  7. nabcoengineer

    nabcoengineer New Member

    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.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    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.
     
  9. trexen

    trexen Member

    nabcoengineer:

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

    tanx, rgds
    Marcus
     
  10. trexen

    trexen Member

    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 http://www.innodb.com/hot-backup/ ?
     
    Last edited: Apr 8, 2009
  11. t-mug

    t-mug New Member

    Last edited: Apr 22, 2009
  12. trexen

    trexen Member

    MySQL repliacation

    i try to figure out how replication works, in http://www.howtoforge.com/mysql_database_replication tuturial it tells me to use exempeldb in my.cnf "binlog-do-db=exampledb" are you referring to ispconfig db that you specify in the installation, default is "dbispconfig" is this correct ?

    And i also wonder if i specify dbispconfig in my.cnf does the replication replicate all db i have, exempel web1db1 ?

    regards
    //Marcus
     
  13. falko

    falko Super Moderator Howtoforge Staff

    If you want to replicate the ISPConfig database, then yes.

    No, it will just replicate the ISPConfig db.
     
  14. trexen

    trexen Member

    Ok, then i need to make a new entry for every new DB customer create ore can this be done in another way to replicate all the DB, som i don´t need to specify every new entry ?

    rgds
    //Marcus
     
  15. falko

    falko Super Moderator Howtoforge Staff

    You need one entry per database.
     

Share This Page