1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setup second Dedicated Server for MySQL and EMAIL Hosting for another WHM Server

Discussion in 'E-mail Discussions' started by amusic, Oct 20, 2010.

  1. amusic

    amusic New Member

    Joined:
    Sep 7, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hello everyone,

    I have a current dedicated server that i would like to use for apache and whm/cpanel dns. I would like to get another dedicated server an have it be my Email and MySql Server with cpanel and without any whm features so it could be administrated easily. What are the steps i need to take to accomplish this ?

    Thank you for the support.
     
  2. cPanelJared

    cPanelJared cPanel Staff
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,840
    Likes Received:
    13
    Trophy Points:
    38
    Location:
    Houston, TX
    Not possible as you describe

    There is no provision in cPanel for creating the type of cluster configuration you appear to be requesting. The only service that can be clustered currently is DNS. You may be interested in our DNS cluster documentation for more information about this feature.

    You can use a remote MySQL server for your databases. This is not meant to be a clustering system; rather, the MySQL service on the local server needs to be shut down, and the remote server will handle all MySQL transactions. Full information about setting up a remote MySQL server can be found here.

    For mail, you can simply make the MX records point to another server, but there is no direct provision for cPanel on one server to be able to control e-mail accounts on another server. Changes you make in the e-mail configuration on the local server would have no effect on the remote server that actually hosts the mail for the accounts. You can come close to what you want by using one cPanel server as a backup e-mail server, but you would still need to manage the accounts on each server separately.

    The type of clustering for most services you are requesting is planned for cPanel 12, but there is no timeframe for when this will be available.

    Other users may have developed work-arounds and third-party add-ons that make this type of clustering possible with current cPanel versions, but I am describing what is currently possible with "stock" cPanel, with no modifications or add-ons. I hope this helps.
     
    #2 cPanelJared, Oct 21, 2010
    Last edited: Oct 21, 2010
  3. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    I did want to expand on the backup mail exchanger idea for emails. As Jared mentioned, you cannot have a cluster for the mail servers, but you could have a setup for each cPanel created account to set it as a backup mail exchanger.

    In WHM > Create a New Account area, you'll see this option:

    How this works would be that the email machine you have as the primary mail machine (primary MX record) will receive emails normally, and when that machine is down, the cPanel machine will be the secondary MX for the accounts. It would receive the emails during the time the primary MX is down, and then deliver those emails to the primary machine once it's back up again.

    In this type of setup, the email accounts would need to be created on both machines (primary MX mail machine and secondary MX cPanel machine).
     
  4. amusic

    amusic New Member

    Joined:
    Sep 7, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    A Big Big THANK YOU!

    I would like to Thank you so much for helping me and Answering my post am i Really Appreciate it a lot!


    I can't wait till cpanel 12 comes out :)
     
  5. InterServed

    InterServed Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    Watching how cPanel progress works i could estimate we still need to wait for like one year or so.
     
  6. asmar

    asmar Member

    Joined:
    Jul 16, 2004
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Too bad that this take ages to be build. Clustering DB/Apache etc is vital in hosting now days.
     
  7. hostmedic

    hostmedic Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    Can multiple cPanel servers share a Remote MySQL easy?
    I know there are some databases that are the same on each server (roundcube, horde, etc)
     
  8. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    Hello hostmedic,

    Multiple cPanel servers can share the MySQL remote database machine, although I am uncertain if I would be able to define easily in describing it. It can be done and it has been done, but usernames cannot conflict in the database.

    One solution for Roundcube might be to convert it to SQLite rather than using MySQL in that instance to ensure it doesn't need to use the remote MySQL database, which then leaves only Horde to deal with in that scenario.

    To convert a Roundcube database from MySQL to SQLite, it is simply issuing this command on the cPanel machine in root SSH:

    Code:
    /scripts/convert_roundcube_mysql2sqlite
    Thanks.
     
  9. hostmedic

    hostmedic Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    Thanks - I used roundcube as an example -
    Generally we stick with all servers using the old style of mysql - where the database is the cpanel username + the db name like this cpname_dbname

    I will give it a shot later today migrating a few together and see how it goes.
    That will be really handy to say the least. :)
     
  10. hostmedic

    hostmedic Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    While asking for clarification to this via a cPanel ticket - Ken, like always, gave a quick response as well as made it very clear:

    Sadly this is a real pain - but I understand. I am hoping cPanel can help us with this in the future and perhaps the easy fix is just to have all the databases use something like an underscore_servername in the database table names - to allow us to get around this issue.
     
  11. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    The best solution in this instance is simply to convert Roundcube to SQLite and to remove Horde as a webmail option. I'd already mentioned Roundcube conversion, but most people prefer Roundcube over Horde regardless, so if your users can live without Horde, then simply drop it and convert Roundcube to SQLite.
     
  12. hostmedic

    hostmedic Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    So - what about any others cPanel uses?
    Just want to clarify this is possible - we ran into a few issues while trying this -
    using the SQL lite and disabling Horde is pretty simple - but want to make sure all other mysql databases wont go to the birds doing this.
     
  13. hostmedic

    hostmedic Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    Please hop in and peek @ cPanel tickets ID# 1358102 - are you saying something different than Kenneth?
     
  14. garrettp

    garrettp Member

    Joined:
    Jun 18, 2004
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Really the only other DBs I can see being a problem are the cphulkd and eximstats databases. I usually recommend disabling cPHulk in favor of CSF or APF+BFD anyways so that just leaves Eximstats. The chances of having a duplicate row/primary key in the Eximstats DB is slim-to-none and slim just left town, so what you'll be left with is a database that has mail stats for all of the cPanel servers using that MySQL instance.

    Of course cPanel is probably going to act weird if you try to create a user on one server that already exists on another, but I presume you would have some sort of procedure to ensure that isn't attempted.
     
  15. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    4
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    There are different methods to achieve the same purpose to try to get multiple machines to connect to one remote MySQL server. What Ken has stated is sound on the option to keep Horde and simply change the password and re-sync it for all the machines. I personally believe it is easier to not use Horde at all and convert Roundcube to SQLite.

    Next, please note that there is nothing in our documentation that states you cannot have multiple MySQL machines connected to a remote MySQL machine. This doesn't indicate we support that setup. If you want to pursue multiple machines to one MySQL machine, you can do it but you will run into some issues that I had already mentioned originally. For example, another consideration would be eximstats and cphulkd also have individual databases. eximstats is going to be skewed for users on both machines and cphulkd will probably need the password re-sync for it as well (if you are using cphulkd on the machines). If cphulkd blocks a user on one machine, that user is going to be blocked on the other machine(s).

    The biggest issue beyond the webmail clients; however, is one I already noted that usernames cannot conflict. You would not be able to have a user admin on one machine and another user admin on another machine. If you do, both users will likely be able to see the databases of the other user in their cPanel account due to the wildcard grant for admin_ for cPanel systems with database prefixing, which looks similar to the following:

    Code:
    GRANT ALL PRIVILEGES ON `username\_%`.* TO 'username'@'%'
    As such, you cannot have the same user on multiple machines in this setup.

    Ken and I discussed this entire matter prior to my latest reply. As far as I can see, we are simply indicating different mechanisms to use for webmail in the setup you are wanting to try.

    Finally, if you do end up trying to achieve this, please only setup two machines for testing it out initially to ensure it works and you are able to see what issues arise. This way you can easily convert back if needed.
     

Share This Page