Knowledgebase

Portal Home > Knowledgebase > Articles Database > Obtaining high availability with Cpanel


Obtaining high availability with Cpanel




Posted by alexcl, 07-23-2013, 04:34 PM
Hello, I'm looking at achieving a high level of availability, since I've had some downtime issues since the begining if the year, a few times because of hardware failure, and also due to software issues. I need to have Cpanel, and with Cpanel high availability can be tricky to achieve ( or at least thats what I've read ). Ok, so here what I'm thinking of doing: Get a second identical server to the one I have now and have all the accounts from server A copied in real time to server B. Then have a small cloud server in front of them, running Cpanel DNS only. Now, my question is this: how can I make sure that wahtever is on server A will be identical on server B ? This includes cpanel accounts being created, email accounts...so basically have a "clone" of server standing by, so if anything happens I can just divert traffic from A to B. Thanks

Posted by Ramprage, 07-24-2013, 12:08 PM
In short, you can't. cPanel was never designed to be highly available. There are duct tape methods people have put together to try to emulate this but they become a nightmare to maintain. It's been requested multiple times in their forums to add high availability email but they haven't offered this, to date. If you want high availability you need to look at alternate software solutions and leave cPanel behind.

Posted by alexcl, 07-24-2013, 12:11 PM
What would the alternatives be and which are the best ones ( interms of efficiency, ease of usage and cost )?

Posted by NoSupportLinuxHostin, 07-24-2013, 01:37 PM
If you want to use cPanel, one option would be to build a cloud environment using something like XenServer or VMWare. Then deploy cPanel within a VPS instance running inside the cloud environment. That will give you some of the HA features without needing to cobble HA functions into cPanel.

Posted by Steven, 07-24-2013, 02:10 PM
How in sync do they need to be? Why not do something like use drdb to sync between two servers and run a virtual machine ontop of it, and then you can failover the entire virtual machine on the other server.

Posted by alexcl, 07-24-2013, 02:16 PM
Basically I would only need the cpanel accounts to be synced, to have the websites working, emails and everything related to the accounts. Server configuration etc. isn't a must. I've seen only great things about your company. Is this something you could help with ? Thanks.

Posted by whmcsguru, 07-24-2013, 03:14 PM
The reality, as others have said is that this isn't possible. The duct tape solutions work, to a degree, but you're still going to have issues. One work around for this is to use clustering. Get a VPS or two for your DNS solutions, use them, not your server, with DNSONLY. Get another server setup specifically for MySQL, and tie that into cPanel/WHM. Of course, you'll have to move the db's manually off to that server, BUT, it's better than having everything on the same server, and it will reduce a bit of load as well.

Posted by usmanbsd, 07-24-2013, 08:21 PM
I have never tried that but I just have 2 questions 1. Isn't bi directional files replication possible? If we just sync the /home of both servers, for example with unison. 2. Isn't MySQL master to master replication possible? and any new database created on any of servers will get created and replicated on other server automatically? (You can ignore the mysql database in replication) Webmail data folders can be synced as well. Then why its that complicated to setup 2 servers in load balancing hosting same sites? Am I missing something here? Regards usman

Posted by whmcsguru, 07-24-2013, 11:06 PM
Nope, you'd need much, much more than just 'home' on both servers synced. cPanel stores a ton of stuff in a ton of different areas. Most of the vital stuff is on /home , but you've got user accounts, passwords, configs for apache, ftp, email, accounts per domain, etc all over the place. I haven't played much with MySQL replication so i can't comment terribly much, but this would, again, get very messy, which is why a MySQL specific server is just a better way to go all around Even if you did do a sync from /home/ to /home/ , you'd have to have a constant scan looking for changed files, and that would as well get ugly.

Posted by NoSupportLinuxHostin, 07-25-2013, 04:36 PM
You make it sound easy, and we all wish it were that easy. Making a copy of a cPanel server is relatively easy, but keeping everything in sync on an active server is a lot of effort. There are some duct-tape style solutions you can try, but you will likely cause more problems for yourself by doing so. Unfortunately, cPanel is simply not designed for that type of high availability. Maybe someday cPanel will add HA functionality. It would be a great move for them since it could double cPanel license sales to existing customers. As for MySQL replication, native MySQL replication is absolutely terrible. If you want to replication MySQL databases, you can use the 3rd party solution called Tungsten Replicator. Tungsten Replicator is very reliable and works much better than the replication built into MySQL natively.

Posted by ZKuJoe, 07-25-2013, 07:27 PM
Every HA cPanel setup I have ever seen uses hardware HA and lets cPanel do its own thing. The easiest setup is running ESXi, Proxmox, or XenServer. Cost will be a big concern though because you'll need a local central storage option like a SAN. Additionally this does not protect against network/power/datacenter outages so you will need something much more advanced (and expensive) for geographic redundancy.

Posted by CloudVZ, 07-25-2013, 07:38 PM
Why not put your cPanel installation on top of high availability IaaS cloud providers? That way you don't have to go through the hassle of replicating 2 different cpanel installations. Most cloud providers have high availability built into their virtual machines so you don't have to worry about it.

Posted by usmanbsd, 07-25-2013, 09:01 PM
Hi NoSupportLinuxHostin and twhiting9275, I want to clear that I am not encouraging anyone here to go for replication etc. Of course things can always get ugly whenever you will have bi directional replications or any complicated scenarios, thats what admins are paid for. What I was saying was that it doesn't seem next to impossible to have something like that. There can be solutions/scenarios to handle http.conf, passwd files etc but I won't dare to propose now, lol. And thanks for telling me about "Tungsten Replicator" next time I am going to try that. Regards usman

Posted by ClaudiuPopescu, 07-26-2013, 09:27 AM
Some options: 1. DRBD Pros: It can be implemented with 2 servers Cons: Watch out for brain split 2. Shared storage (iSCSI for example) Pros: A lot faster than DRBD Cons: Requires a 3rd server with the role of storage Again this are a few options at hardware level, not at cPanel level. You should ask yourself if you really need HA at cPanel components level.

Posted by gnusys, 01-18-2016, 05:42 AM
Just bumping this old thread to let the OP know this is now possible (at least web server clustering ) if you follow the tutorial at https://support.sysally.net/projects..._cluster_setup It uses unison to sync /home and csync2 to sync nginx config and php settings.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read


Language:

Contact us