The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create a failsafe backup server

Discussion in 'Data Protection' started by inettech, May 21, 2012.

  1. inettech

    inettech Registered

    Joined:
    May 21, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    We currently have one cloud server running CPanel WHM and we want to have a failsafe backup server if our primary server goes down.

    We've searched the net about how to do that but either the post were really old or not complete.

    What we want to have is a way to automatically copy all CPanel account to the backup server once a day.

    We have multiple question :

    1 - Do we need a special plugin/module/software to backup and restore all the data from the primary server to the backup server ?
    2 - If we don't need any special plugin/module/software, what is the best way to achieve a copy of each account to the backup server ?
    3 - Do we need two CPanel licence (one for the primary server and one for the backup server) or can we just stay with our current Cpanel licence for the primary server ?
    4 - When copying account to the backup server, will the account IP change according to the avaiable IP on the backup server (since they do not have the same IP address).
    5 - We read a couple post talking about using dnsmadeeasy.com for failsafe dns, what does this do ?
    6 - Should we use the DNS clustering option in CPanel WHM, if yes, what does this do exactly and what are the advantage and inconvenient ?
    7 - We were wondering why CPanel does not have a built-in tools to do mirroring between server, does it exist somewhere ? If not, is it planned in a futur release ?

    For failsafe DNS, we want to setup the nameservers of all our customer account like this :

    ns1.ournameserver.com : Primary server IP Address 1
    ns2.ournameserver.com : Backup server IP Address 1
    ns3.ournameserver.com : Primary server IP Address 2
    ns4.ournameserver.com : Backup server IP Address 2

    This way, if the primary server does not respond, the request will automatically go to the backup server wich will respond, is that setup correct ?

    Thanks for helping us on all those questions and giving us hints on how to achieve what we want to do.

    Vincent Cadieux
    Inet Technologie
     
  2. jerrybell

    jerrybell Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    From my observations of the forum, there's a fair bit of interest in a fail over system, but CPanel doesn't support it and I'm not aware of any modules to automate it.

    My recommendation would be to set up the backup server and install a validly licensed copy of cpanel. Set the main server to perform daily backups either using FTP or locally and rsync/rsnapshot across to the backup server. Then, you can script a restore of each account on the backup server.

    Another thing you could do to make restores even more timely is to backup all the accounts to the backup server, run a restore of all the accounts (so the accounts and data exist on the backup server), and disable all the services (mail/web/ftp/etc). Then, you could periodically (hourly?) run an rsync of the home dirs of the accounts from the primary server to the copy on the backup server. Should the primary serer fail, you would only need to start up the services to be back online. Something tells me there may be a gotcha or two with this, but I am thinking that it is probably doable.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    One gotcha would be rsyncing MySQL data. I'd suggest instead to cron a mysqldump of MySQL data, then scp over the SQL backup file created. Rsyncing InnoDB-table data could end up with corrupted MySQL tables.
     
  4. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Its not that cPanel does not support it or does not want to support it. cPanel is just a control panel GUI for allot of server softwares not provided by cPanel, this means your fail over needs to be done with Apache, MySQL, Exim, etc.

    This is an extremely complicated setup and cannot be done that easily. Fail over systems costs allot of money and I don´t think its that easy to do it with so many different server softwares running like cPanel.

    The way to do it is with virtualization at the OS level, and again this costs money as you need to sync data in real time. What the OP posted was asked by hundreds of people here and in other forums and my guess is they just dont know how data works when traveling to a server.

    The first thing they came up is a with a DNS fail over and they think having an exact cloned server somewhere else will work. I don't even want to start explaining what kind of mess this is if something happens to be out of sync. Its way to much work and configuration and even so its not going to work like you expect it to work.

    There are solutions to this and I have done it before. But you need completely to leave cPanel out of the picture go a level up to the point the whole OS needs to be sync in real time without a glitch. And this is complicated as both servers need to be close, max 100 miles, and this is pushing it already with a 1 Gigabit links and you need to keep latency under 10 ms.

    When people figure out how much this can costs them, they just prefer to actually have the downtime. And if your business and services are critical to the point that 1 minute means saving someone lives, then I guess you would not be using cPanel for hosting this services either, as cPanel is for shared hosting and usually shared hosting is budget services.

    Sometimes you can just have more downtime if you complicated or over complicated your setup to much. Keep it simple.

    Its a costly solution.
     
    #4 nibb, May 25, 2012
    Last edited: May 25, 2012
  5. jerrybell

    jerrybell Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Nibb, I think there's a big difference between continuous availability and fail over capability. I have done a bunch of both over the years. I think it is entirely practical to come up with some kind of failover mechanism like I described and could be 'managed' by the whm/cpanel interface. Now, that likely would not be advisable for some kind of sites where losing a few minutes/few hours worth of transaction data would be really bad, but then I don't think those kinds of sites tend to be on shared hosting platforms anyhow.

    What would be really cool is not only a capability for a service provider to do it, but for a client and/or reseller to do it at the cpanel level in a manner that would be hosting provider agnostic (ie, I could have a 'warm' failover account with another hosting provider and could initiate a failover if my primary went down)
     
Loading...

Share This Page