Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to make a second cPanel server redundancy?

Discussion in 'Bind/DNS/Nameserver' started by thesrever832, May 18, 2018.

  1. thesrever832

    thesrever832 Member

    Joined:
    Mar 28, 2018
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    jupiter
    cPanel Access Level:
    Root Administrator
    Say that a user has two cpanel/whm servers. I just wanted to know about this for information reasons.

    Now, say that a user wants to have a second server redundancy of some of the sites on the first server in case server 1 goes down it will show server 2 instead.

    Will this then be the correct way to do it:

    0.
    Assume 2 servers exist with full cpanel/whm

    1. User goes to domain registrar.
    They set up their nameservers for example1domain.com like this:
    ns1.serverone.com
    ns2.serverone.com
    ns1.servertwo.com
    ns2.servertwo.com
    [assume these name servers are correct for your server #1 and server #2]

    2. Assume that currently, the example1domain.com website is on an account in server #1. User takes a backup and restores the backup to server #2 so now they have a carbon copy of their account and site on both servers.

    Would it be correct that if the server #1 goes down, then the site will now show up at server #2 for minimal or no downtime?

    If so great, if not, please tell me any steps I missed. Thank you.
     
  2. Babene7

    Babene7 Member

    Joined:
    Apr 13, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Uruguay
    cPanel Access Level:
    Root Administrator
    Hello,

    Instead of using 4 NameServers, just add your domain to CloudFlare's free plan, and create 2 A records for the main domain and for each subdomain. One of the records should point to server 1, and the other to server 2. So you will have this configuration for example:
    • example1domain.com pointing to 1.1.1.1 (let's assume server 1)
    • example1domain.com pointing to 2.2.2.2 (let's assume server 2)
    • anysubdomain.example1domain.com pointing to 1.1.1.1 (let's assume server 1)
    • anysubdomain.example1domain.com pointing to 2.2.2.2 (let's assume server 2)
    • anothersubdomain.example1domain.com pointing to 1.1.1.1 (let's assume server 1)
    • anothersubdomain.example1domain.com pointing to 2.2.2.2 (let's assume server 2)
    If server 1 goes down, then login to CloudFlare and remove the records pointing to server 1. This way, in an hour or two all your traffic will be going only to server 2. Add the records back once server 1 is online again.
    If you use 4 NameServers instead, you'll be losing 50% of your traffic for longer than just an hour or two. It's always better to remove/add A records than to remove/assign NameServers because they take way longer to fully propagate.

    Now regarding the site, will it always stay the same? Won't it receive any updates? If so, then you're set, just do step 1 the way I suggested but do it after copying the site to server 2, not before.
    If your site is updated often, then you will need to use a proper data replication. This is not easy in cPanel servers, the main problem here would be MySQL replication, you can check this thread but remember that it's unsupported: Mysql Master-Master replication is not working??
    The files replication is easy to do, you just need to use lsyncd for that.

    Also, whether the site receives new content or not, you won't be able to replicate proper cPanel stuff, like your email accounts, FTP accounts, etc. Or at least I've never done it. Maybe it's possible though I haven't seen something like that so far.

    Hope this helps!

    Regards.-
     
  3. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,741
    Likes Received:
    76
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    You can do that but it would be rather cumbersome as to keep current data you would need to back up often

    We do this for our own server and for some clients single accounts.
    We set up master salve MySQL replication for just the sites that we want to run HA (if they have databases).
    we rsync the home/user every hour (time would depend fresh you need it).

    Server 1 fails with have a custom monit script on a monitor server that runs our own in house round robin DNS that brings up the sites on the HA server and syncs the DNS cluster. We used to use DNS made easy fail over which works much better but we built our own to save $$.

    Our monit install will detect when the main server is back on line and it will automatically sync the site and back and reset the master/slave MySQL.

    It works with our custom round robin DNS or with cloudflares API.

    I will admit it works flawlessly with our clients sites but our own server sometimes does not fail back.
    We just need to tweak the monit script a bit I do believe. Since its our own server we are just lazy
    and its no big deal to run the switch back manually.

    We did try with a master master MySQL as babene7 suggested but found database's would get trashed to easy when they got out of sync so it was more trouble that its worth. With master slave it does not happen.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. thesrever832

    thesrever832 Member

    Joined:
    Mar 28, 2018
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    jupiter
    cPanel Access Level:
    Root Administrator
    1. I HATE CLOUDFLARE I will never get it.
    2. I am not buying any other services, I don't care if it is cumbersome. In fact most sites are static so it's no problem. I am never routing through any third party.

    So, it will work the way I originally suggested? Or is there a better way without cloudflare?
     
    kiti likes this.
  5. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    222
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. thesrever832

    thesrever832 Member

    Joined:
    Mar 28, 2018
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    jupiter
    cPanel Access Level:
    Root Administrator
    These links are actually useful features if implemented, but DOES NOT address my actual question in this thread.

    My question is asking assuming if I ALREADY have a full duplicate of data, asking what the easiest [NON-CLOUDFLARE] way to set up DNS redundancy so that if one server goes down, DNS reverts to other server, with no downtime.

    Still waiting for an answer.
     
  7. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,741
    Likes Received:
    76
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    dns made easy with dns failover
    dnsmadeeasy.com
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    222
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. thesrever832

    thesrever832 Member

    Joined:
    Mar 28, 2018
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    jupiter
    cPanel Access Level:
    Root Administrator
    THIS IS POSSIBLE. I WILL CHECK THEM OUT.
     
    #9 thesrever832, Jun 8, 2018
    Last edited by a moderator: Jun 8, 2018
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice