Failover solution

Ankh

Verified User
Joined
Feb 20, 2006
Messages
18
Hi,

we are using Directadmin for several years now on a normal colocated box. In the past years we had some hardware problems with it, even though it was SLA covered the downtime was not good. So we are planning to move the server to a VPS. This way we can eliminate any hardware errors.

A customer wants to know if we can setup a website Failover/backup solution. At the moment we already using a failover DNS and mail solution (our domainhoster offers a DNS zone transfer option and a Mailrelay solution). But the webserver (apache) is our problem.

The customer has a website serving PDF files / information for different schools throughout Holland. These PDF files / information need to be online.
It isn't a problem if the main website is down, but the login page (based on a simple mysql script) and the files underneath need to be available.

We have searched and searched, but can't find a good solution.

First find on the internet was Round Robin DNS, but this means 50% goes to main and 50% goes to backup.. We can't redirect any people..
A Loadbalancer was found aswell.. only this means a full fledge system which means a duplicate of our VPS.. But we want to run it on a different hoster in Holland aswell..

So I am hoping that anybody on the DA forum has an idea or is using a similar system.
Is there anything "simple" available?

Thanks!

Paul
 
Setup mysql in a master master replication and setup apache in high availability. There are tons of guides all over the internet to setup clustering with linux servers. You also need to look at things such as session clustering so that connected clients are not kicked off and lose session variables. You should build a test lab with vps servers to see what you can come up with. You do not need directadmin to start off.

Here is one guide, but I am sure there are way more better ones.

http://www.howtoforge.com/setting-u...alancer-with-perlbal-heartbeat-on-debian-etch
 
Hi!

Thanks for your quick reply.

We want to setup a 2nd server using a totally different hoster. So if host1 is down, we want to serve this website on host2.
All of the guides I found are based on load balancers based on a private network (which keeps the price down), but as I see it we can only work with a public based load balancers.
Maybe I see this incorrectly..
 
Hi!

Thanks for your quick reply.

We want to setup a 2nd server using a totally different hoster. So if host1 is down, we want to serve this website on host2.
All of the guides I found are based on load balancers based on a private network (which keeps the price down), but as I see it we can only work with a public based load balancers.
Maybe I see this incorrectly..

A good approach would be to setup master/slave for mysql and use a 3rd party dns service with very low ttl.
This is what i am doing for critical sites.
 
Do you neee MySQL to automatically replicate? If only you update your MySQL database, then you don't; you can do the MySQL part manally, updating both servers. If you do, I'll leave how to do that up to you' it's well documented on the 'net.

As far as DNS without the problem of round-robin, here's my quick and dirty solution:

For the domain use dns as follows:

For example, for the domain named example.com:

Have example.com, use nameservers named ns1.example.com and ns2.exaple.com.

ns1.example.com should run on Server A and point the site to Server A. ns2.example.com should run on server B and point the site to Server B.

Then when both servers are up visitors will more or less be distributed among both servers, but when one servers are down, only one DNS record will be found and the erver that's up will serve all requests.

Here's how DNS works:

Your desktop sends a request for IP#. All active DNS servers for the domain are queried, and all will reply. Your desktop will take the first reply it gets, and use it, so the least loaded machine will get visited by your desktop. If only one IP# returned, only one sever wll be visited.

Use a fairly low TTL for prompt failover. We find 600 (ten minutes) works for us but you might want to use something as low as 60 (one minute). The lower your TTL the more hits your DNS gets.

Jeff
 
Back
Top