Multiple cPanel servers, one DB server?

jimmystack

Registered
May 30, 2019
2
1
1
London
cPanel Access Level
DataCenter Provider
Hi all,

Wanted to ask some advice here.

I have a customer with a number of sites that need to be load-balanced. The idea here is to have two web servers, a load balancer, and a single MySQL server between them. Each web server, running cPanel, would use the single mysql server for databases.

Is this an advisable setup? Is it safe to connect two cPanel servers to a single remote mysql server? I know there’s a warning in the docs about it, but has anyone actually used it?

If not, can I simply have the remote mysql server connected to one server, and have the applications on the other connected to the DB server IP directly?

How do you manage grants and users etc? Do these need to be manually added?

Looking forward to hearing your advice/horror stories/best practices :)
 
  • Like
Reactions: Vaidas T.

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,774
328
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
My advice is that if this is just one domain would be to not use cpanel at all.

If you need cpa el for mail or something get a separate vm with cpanel and just use it for the mail services.

Even if it is more than one site trying to do this with cpanel is not a road I would advise going down.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello @jimmystack,

We document how to connect a cPanel & WHM server to a remote MySQL server on the document below:

Manage MySQL Profiles - Version 80 Documentation - cPanel Documentation

While technically this is possible, note the warning on the above document regarding the use of more than one cPanel & WHM server on a single remote MySQL server:

We strongly recommend that you only connect one cPanel & WHM server to each remote MySQL server. If you connect multiple cPanel & WHM servers to one remote MySQL server, you may experience database and username conflicts.
For instance, if the same database name or database username exists on multiple cPanel & WHM servers, then conflicts could arise on the remote MySQL server because it would have no way of determining which cPanel account owns the database.

The feature request to follow for better integration of remote MySQL servers is found on the link below:

MySQL Only version of cPanel & WHM

Thank you.