bughatti

Registered
Nov 26, 2019
3
0
1
Billings, Montana
cPanel Access Level
DataCenter Provider
Hello all, new to the forum. Sort of new to cpanel, I have been using it for about 4 months now at my work. I have some questions I hope others can help me with.

A few months ago I setup an internal mariadb galera cluster and put it behind haproxy. It is a 2 node cluster for now. I could not find a direct document on describing how to do what I wanted so I pieced together from a few different articles. So far I have 1 cpanel server running with the cluster as a remote database and I have not come across any issues, I have 7 sites running and from what I can tell, they all act just as normal as a standalone cpanel/db server. Yesterday I built a second cpanel server and added the same clustered db to it as the other one. I am using the same username/password to access the clustered db from both cpanel servers.

Does anyone have experience in doing this type of setup, pros/cons? Is there a best document to follow for this setup.

2 big questions I have so far in testing. When using the transfer tool to transfer a site from 1 cpanel to another cpanel, is it best to uncheck copy database, since both cpanel servers have access to same database. I would assume if I transferred the website without the database, it would know how to reconnect and its location/permissions.
I have tested moving a site over, it is a pretty basic wordpress site, the site at the new IP address says error establishing a database connection. If i change my local dns to point the site back to the old ip, the site works fine. This tells me something in cpanel is an issue even though the error seems to be a wordpress issue. I have validated the wp-config files on both locations and they both match. I do not see duplicate databases in phpmyadmin.

Thanks for any advice or assistance.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,421
689
263
Houston
cPanel Access Level
DataCenter Provider
Does anyone have experience in doing this type of setup, pros/cons? Is there a best document to follow for this setup.
This isn't something cPanel currently supports natively but I'm sure others have configured something similar.

2 big questions I have so far in testing. When using the transfer tool to transfer a site from 1 cpanel to another cpanel, is it best to uncheck copy database, since both cpanel servers have access to same database. I would assume if I transferred the website without the database, it would know how to reconnect and its location/permissions.
From what it sounds like you have setup, no it wouldn't be necessary to copy the db but I'm hesitant to believe after reading the rest of the thread that this is setup up properly

I have tested moving a site over, it is a pretty basic wordpress site, the site at the new IP address says error establishing a database connection. If i change my local dns to point the site back to the old ip, the site works fine. This tells me something in cpanel is an issue even though the error seems to be a wordpress issue. I have validated the wp-config files on both locations and they both match. I do not see duplicate databases in phpmyadmin.
This tells me that each "cluster" member is potentially accessing the DB locally or if accessing a remote db (which is supported) it hasn't been configured correctly.


You CAN most certainly utilize one DB server for multiple cPanel servers. This can be configured using Manage MySQL profiles and documentation on this can be found here: Manage MySQL Profiles - Version 84 Documentation - cPanel Documentation
 

bughatti

Registered
Nov 26, 2019
3
0
1
Billings, Montana
cPanel Access Level
DataCenter Provider
You CAN most certainly utilize one DB server for multiple cPanel servers. This can be configured using Manage MySQL profiles and documentation on this can be found here: Manage MySQL Profiles - Version 84 Documentation - cPanel Documentation
[/QUOTE]


I am reading this under the document you posted

"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. "
 

bughatti

Registered
Nov 26, 2019
3
0
1
Billings, Montana
cPanel Access Level
DataCenter Provider
Yep, that's definitely a concern, while we advise that, it isn't unsupported and we're moving to more of a node based approach which would offer further support for this. Unfortunately, in the meantime there is no measure to check for conflicts such as what's suggested.

Ok thanks for the information. So reading the document, I am not sure if I set it up correctly or incorrectly. It is a galera cluster, so normal mysql install and the mysql servers replicate with each other while always having a master node. The few articles I used


I have 1 user on the database that is used by haproxy to send commands, that user is a superuser and has same root privileges to make changes to the database. Both cpanel servers use this same account and validate fine when adding the remote db under mysql profiles.

When looking at everything under phpmyadmin at server level and user account level for each user, I see no issues. I have no issues creating databases or deleting so far.

I will say thinking about this setup, anything I transfer between multiple cpanel servers, I have to be cautious about deleting an account as it will likely erase the database associated with the website which means it will no longer exist for the original server it was hosted on.

Would it be better to create different mysql superusers for each cpanel server when accessing the shared database?

What kind of timeline do you have for a more supported setup like this?

Thank you for the responses and support!