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.

Redundancy with 2 cPanel servers

Discussion in 'General Discussion' started by vs-fam, Nov 17, 2016.

  1. vs-fam

    vs-fam Active Member

    Joined:
    Mar 18, 2010
    Messages:
    30
    Likes Received:
    1
    Trophy Points:
    58
    Hi,

    I have 2 servers, one is the "master" and the other is a hot stand by. I want to improve the setup.

    So far I'm doing the following:
    • Initially, all accounts on the master server were copied over to the standby server.
    • Using DNSME service for domain failover to the standby server.
    • Static content is being synced with rsync with a cron job per account (just public_html).
    • MySQL is set with Master-Master replication.
    Considering the second server will be used just as an emergency for a limited time, i can live with limited functionality (ie. no email service) in the mean time.

    The major problem this setup is giving me is that I'm missing some configurations:
    • New MySQL users and DB in cPanel aren't showing.
    • Obviously, new accounts created on the master server won't be created on the standby. Although their new DBs get replicated as orphaned.
    • Same with new subdomains, aliases, etc.
    Can you recommend a better way to do this? All suggestions are welcome.

    Thanks
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,958
    Likes Received:
    1,274
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. vs-fam

    vs-fam Active Member

    Joined:
    Mar 18, 2010
    Messages:
    30
    Likes Received:
    1
    Trophy Points:
    58
    Hi,

    I'm aware of those feature requests that have 4 years opened for discussion. There's not much information there either aside from using rsync to sync web content only.

    It would be nice if cPanel staff could put up a 'howto' in the mean time on how to nearly achieve this considering you have inside information. What to sync, how, tools, etc. Just like the one to replace mysql with percona and other 'unsupported' tutos.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,958
    Likes Received:
    1,274
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I can offer some advice on some of the major issues you listed. To clarify, is the remote system live with a valid cPanel installation, and able to accept remote connections? If so, you may find the standardized hooks functionality helpful:

    Guide to Standardized Hooks - Software Development Kit - cPanel Documentation

    You could setup hooks on the source cPanel server to automatically run a custom script that performs actions on the secondary server. For example, let's say you wanted to run a custom script that created an account on the destination server anytime an account was created on the source server. You could setup the custom script to run automatically after every new account creation using a post "Accounts::Create" hook:

    Guide to Standardized Hooks - Whostmgr Functions - Software Development Kit - cPanel Documentation

    Thank you.
     
Loading...

Share This Page