Best set-up for a backup server?

Discussion in 'Installation/Configuration' started by trigar, Jun 12, 2007.

  1. trigar

    trigar New Member

    I bought a server (A) and installed as Perfect Debian Sarge with ISPConfig. All working perfectly and hosting several webs beautifully (thanks to help from you guys). The only problem was the lack of a second nameserver and a backup server to allow for downtime...

    So I bought a second server (B) set up as Perfect Debian Etch, transferred ns2 to it and set up DNS slave records pointing to server A.

    I then followed the howto on rsync to mirror the webs in server A across to server B.

    All working perfectly, except of course that the webs on server B are not accessible, given that they have not been set-up via the Control Panel and don't have any domains pointing to them.

    So really this only sorts out the nameserver problem and I suppose gives me the confidence of knowing that I could get server B up and running pretty quickly, if I had to. What it doesn't do is provide me with the ability to shutdown server A for a few hours whilst I upgrade it, or indeed cope with any unplanned downtime.

    The obvious thing to do would be to copy the ISPConfig data over to server B, perhaps by doing a backup/restore through the control panel? But presumably that would mess up the slave DNS on server B. Perhaps I need to remove the slave DNS first and recreate it after? Somehow this doesn't feel right.

    So, to cut this question back to a simple request, is there a recommended set-up that would provide me with:

    • Two nameservers
    • A backup server available on demand

    Surely this is what everyone must want or perhaps already have, but I have spent hours reading and Googling the numerous references to multiple servers or backup servers, but I'm just not finding my answer, or perhaps I'm not recognising it when I see it!

    Is the only ISPConfig answer to await ISPConfig 3, or is there a current best way to approach this?

    Many thanks.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    There's one big problem if you copy all configurations over from A to B: some configurations (e.g. Apache) contain the IP address of server A, so the configuration doesn't work on B (unless B gets A's IP address when A is down).
     
  3. trigar

    trigar New Member

    Thanks Falko.

    On the basis that everyone has to have at least two servers (for the two required nameservers) what do most people do with the second server?
    • No second nameserver
    • Leave it otherwise dormant?
    • Rsync or mirror in some other way from primary?
    • Have a mix of webs on each server to spread the load (and backup both via CP or some other way)?

    Or is there a better way have setting up a resilient webhost using ISPConfig?

    I do feel I am missing something fundamental, but if this is just a limitation of the otherwise fantastic ISPConfig system, then I will just try and make do until the much anticipated ISPConfig3 launches!!

    Thanks.

    Chris.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig 2 was just build zo manage single servers, do i would call it a limitation in ISPConfig 2 :)
     
  5. sjau

    sjau Local Meanie Moderator

    Actually, I've encountered quite a few registrars that don't require to independant nameservers... before I had my second server for .net/.org/.com and .ch domains I could setup two nameservers on the same IP (ns1/ns2) and that was accepted... now I have setup ns3 on the second server for .de and .fr domains..
     
  6. trigar

    trigar New Member

    That was exactly how I had ours set up, prior to our second server, but I had an aversion to the red failures in http://www.dnsreport.com/!

    Thanks, Chris.
     
  7. stefan

    stefan New Member

    When I understand you correct you need a high-availbility solution. How is it with a cluster?

    stefan
     
  8. trigar

    trigar New Member

    Thanks Stefan. Of course you are absolutely right, but I don't believe this is possible using ISPConfig servers and, quite frankly, I don't think my knowledge is good enough for me to start setting up Virtual Hosts without ISPConfig.

    I'm coming to the conclusion that the best arrangement is going to be to set up webs on server B for www2.example.com, www2.another.com, etc, then individually rsync the content from server A for www.example.com. www.another.com, etc.

    Whilst hardly an elegant solution and it certainly wouldn't provide me with the resilience I was after, nevertheless it would enable me to have a tested and known working backup system and thus the confidence of knowing that I would be able to get it swapped over pretty quickly.

    It also means that I would have the flexibility of being able to host sites on server B in order to spread the load (and rsync back to server A) so that both servers are working as primaries for some sites, but with the ability to take over those sites for which they are working as backups very quickly.

    As I say, "elegant" is certainly not a word that would apply, but I guess it should be adequate. Any technical reasons why this wouldn't work?

    Thanks.
     
  9. trigar

    trigar New Member

    Seems to all work fine, except that of course the owner and group are not appropriate for the destination. I.e. source web is web13, destination is say web4 (ideally these would be in sync, but there does not seem to be anywhere in ISPConfig to set the web_ID). So I believe the only solution is to change group and owner after rsync has completed?

    The rsync command looks like this:

    Code:
    /usr/bin/rsync -avz --delete --exclude-from="/root/rsync/excludes" -e "ssh -i /root/rsync/mirror-rsync-key" [email protected]:/var/www/web13/ /var/www/web4/
    
    I knew this idea wasn't elegant, but it's starting to look positively ugly... Any thoughts? :confused:

    Thanks.
     
  10. sjau

    sjau Local Meanie Moderator

    try:

    Code:
    man rsync
    
    And look for the permission/ownership switch.

    I think it should be:

    Code:
    -avpz
    
     
  11. trigar

    trigar New Member

    Thanks, but the problem is this the "-p" preserves the source permissions (a good thing) but the "-o" and "-g" also preserve the source owner and group (not what I want). What I want is some miraculous switch that inherits parent details from the destination directory!

    I suppose the answer is to move all the crontab rsync tasks to a script and add the following lines after each one:

    Code:
    $ /usr/bin/rsync -avpz --delete --exclude-from="/root/rsync/excludes" -e "ssh -i /root/rsync/mirror-rsync-key" [email protected]:/var/www/web13/ /var/www/web6/
    $ chown -R web6_username /var/www/web6
    $ chgrp -R web6 /var/www/web6
    
    Should work, I think, although how I am going to cope with having two sets of users and webs with different names on both servers... :(
     

Share This Page