Help - Search - Members - Calendar
Full Version: Server Load Balancing with cPanel
The Planet Forums > System Administration > Load Balancing
funksta
Hi,

After having a server go down for nearly 24 hours and being in-undated with complaints from hosted customers we contacted EV1 for a solution. We were advised that a load balanced pair on a public switch would be the best option. When we asked if cPanel could be used with this we were advised it could. So we took them up on their offer and had this set up knowing that this was going to be a very complex task.

Anyway, we have all the sites on the new servers now and currently using round robin DNS. We have switched two sites to load balancing to test.

To give an overview, we have 2 cpanel servers, cpanel on each, 4 virtual IP's bound to the switch and 4 IPs bound to each server like this:

Server 1 Virtual IPs Server 2
192.168.0.1 => 192.168.0.9 => 192.168.0.5
192.168.0.2 => 192.168.0.10 => 192.168.0.6
192.168.0.3 => 192.168.0.11 => 192.168.0.7
192.168.0.4 => 192.168.0.12 => 192.168.0.8

For each of the two domains we have tested we have an A record for the virtual IP and have removed the A records for the individual servers. We are also using DNS clustering in WHM to synch the DNS changes across both servers. This works fine and with and traffic is being sent to both sites. The main problem we have is with mail.

We have created a hostname for each server like so:

mx1-mail.domain.net
mx2-mail.domain.net

We have bound these to two IPs (one on each server) and made this change at the registrar end also. We used the servercommand portal to set up PTR records to ensure reverse DNS is set up. The set up is like so:

We created A records for both of these in the 21chosting.net zone file:

mx1-mail.domain.net. 14400 IN A 67.15.114.186
mx2-mail.domain.net. 14400 IN A 67.15.114.189

and 2 MX records to load balance across each server:

domain.net. 14400 IN MX 10 mx1-mail.domain.net.
domain.net. 14400 IN MX 10 mx2-mail.domain.net.

This works great, the domains receive emails however, in our mail client we cannot send and receive mail. I presume this is because we are trying to log in to port 25/110 on domain.net and not mx1-mail.domain.net. When we set the POP3/SMTP server to mx1-mail.domain.net we can send and receive. but not when entering domain.net. I assume this is because domain.net is fixed to a virtual IP and the switch does not know where to send traffic.

It took me a while to type this so I would be most grateful if someone could offer any assistance at all. Are we trying the impossible? Are there any workarounds? Someone must have had similar experiences.

Thanks
Liam
eth00
What are you trying to do is impossible with your current setup. The load balanced pairs are a cheaper solution to the private rack + load balancer (fairly costly per month for a small operation) and as such only load balance a few ports. On port that is not load balanaced is 110/143 for pop3/imap. You unfortunatly either need to upgrade (very expensive) or more likely just use the mail.domain.com

Be aware as well if you are load balancing the email depending on your setup you may have to check it on both to get all of the email. I would suggest setting up 1 as the primary mailserver and then on the second one using /etc/secondarymx to have it just spool mail if the other goes down. True it is not real redundancy because you loose the ability to recieve mail but at least it is storing it. That being said if you already have something worked out for your needs more power to you icon_smile.gif
funksta
Thanks for that, I did however get this same information from a tech at EV1.

Before we tried the set up we have we tried using mail.domain.com but because there was a CNAME for mail it did not work as it was eventually pointing back at the virtual IP on the SLB and in turn not working.

What we have had to do is create the following using the same domain name as the hostname:

A record for pop.hostname.net:

pop.hostname.net. 14400 IN A 67.xx.xx.xx

MX Record:

domain.com. 14400 IN MX 10 pop.hostname.net.

This seems to work fine by setting Outlook to send and receive using pop.hostname.net but with this set up, we will need to tell our customers to use the same POP3 and SMTP mail server as mail.domain.com doesn't work.

Is there a way around this? Would removing the CNAME for mail.domain.com in each zone work? Are there any implications in doing that. To be fair I don't even know why there is a CNAME for mail.

We gave up on the idea of load balancing of mail seeing as it is impossible haha icon_biggrin.gif

Thanks
Liam
funksta
Removed the CNAME and set up an MX record for mail.domain.com and pointed it to the main server IP with a A record and it worked.

I am assuming that the mail CNAME is for mailman is this correct?

Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.