• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 670
  • Last Modified:

Load Balancer - CPANEL

Hey so I dont think anything exists for this right now.. but i wanted to see

I have a setup 2 servers as DNS ONLY servers only and they forwards to another server with the actual site on them. I then copied the exact setup on the other side of the country. I setup mysql/rsync replication for the sites so its synced.. I am now trying to figure a good way for load balancing..

Current Setup
NS1.VA --------|
           |
                        -- CLOUD1.VA
                       |   
NS2.VA --------|


NS1.TX --------|
          |
                        -- CLOUD1.TX
                      |   
NS2.TX --------|

Open in new window


What I want to do is make two NS1.domain.com and NS2.domain.com and these be windows server 2008 and have 4 NS records in this system with a different metric to fail over but I’m still seeing the problem of “if cloud1.va is down.. ns1.va isn’t and still gets the request thus everything is still down even though tx isn’t..

MY SOLUTION

write a C++ Program that listens on port 53, gets the requested site and looks in a database (MSSQL) to grab the first listed (or round robin) listed site ip and return the dns request with that.. Dynamic.. then we have another that monitors and pings every 10 seconds (or if the server goes down we manually set it in the db) and if 2 fail it marks in db to be down until it gets 4 successful hits to that server..
0
Phelms215
Asked:
Phelms215
  • 3
1 Solution
 
PapertripCommented:
Sorry but this is confusing, some things do not make sense.

Why aren't you using masters/slaves and zone transfers?

What I want to do is make two NS1.domain.com and NS2.domain.com and these be windows server 2008 and have 4 NS records in this system with a different metric to fail over but I’m still seeing the problem of “if cloud1.va is down.. ns1.va isn’t and still gets the request thus everything is still down even though tx isn’t..
This hurts my brain trying to figure out what you mean.  Why don't you just list TX NS's for secondary on VA clients and vice versa?

I'm very good with DNS but just don't understand what the heck you are trying to do, and can almost promise there is an easier way to accomplish your goal.
0
 
Phelms215Author Commented:
This hurts my brain trying to figure out what you mean.  Why don't you just list TX NS's for secondary on VA clients and vice versa?

Because as I mentioned it's cpanel DNS ONLY servers. NS1.VA for example has the records from cloud1.va.domain.com .. the only way I could add the information from tx would be to setup a cluster between the two sites (even if it's one server) the problem I see is that doing that will overwrite the DNS information so then everyone goes to tx no matter what .. rather than a lower metric..

What I mean by NS1 is that I don't want the "failover" to be at the client level then they have to wait for their DNS cache to expire before it in fact fails over correct? My fix for this was to have a 2008 DNS server that had all four entries in it (name servers) with a lower metric for TX so it could go to any of the four NS servers.. but I still see the problem as if cloud1.va is down.. but the 2008 sees ns1.va.domain.com up it will attempt to get the information from their thus giving the incorrect domain.

I tested this last night by powering down the server and it appears to be the case the servers wouldnt failover even though all nameservers use each other for DNS...

0
 
ArneLoviusCommented:
There are two issues that have been compounded into 1

1/ Load balancing, to spread the load between both web servers.
2/ High Availability, to ensure that if one server becomes unavailable, the other will service requests.

1 can be done on a basic level with "round robin" DNS
2 is much more complex and CANNOT be done with DNS as the browser cache is the issue.

If you just want to guard against server issues, then you could put something like haproxy in front of each server, and have it "fail over" (redirect) the traffic to the other server IP address is its "local" server goes down.

Guarding against other fail modes such as a lack of connectivity to the hosting location requires considerably more complex methods.

I wouldn't use Windows DNS. I;d use either BIND or djbdns

if both sites are live, then your replication must be two way replication, if the second site is just for failover and you have setup one way replication, how do you "fail back" ?



0
 
Phelms215Author Commented:
I have done this differently by making a PHP script to do DNS on two new VMs then they point to the other servers, rsync and mysql replication in the background to ensure file data is working correctly.
0
 
Phelms215Author Commented:
Custom solution since no market option exists.
0

Featured Post

Reclaim your office - Try the MB 660 headset now!

High level of background noise often makes it difficult for employees to concentrate fully on their jobs – or to communicate clearly on calls. The MB 660 headset helps you create a disruption free workspace.  

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now