By appsfact
I am using Ubuntu 12.04 and I need to implement simple/effective Load Balancer / Fail Over System as per the below requirements:
a. It should balance the load between two different public IPs (two different servers on different VPS hosting companies). I need to balance my web application (PHP, MySQL) and also my email server (Postfix, Dovecot, Spamassasin, clamAV, amavis)
b. I don’t want to use more than two servers. The project (web application+ email server) are deployed on two servers and I have only two IP addresses (IPv4).
c. I don’t want single point of failure, i.e., the load balancer/failover must work on both servers, so in case one machine is down, the second will take over.
I have seen many tutorials on how to make the balancer on servers on same subnet, but I need to make it between two servers on different datacenters.
Would you please advise if this can be done? I would greatly appreciate if you provide me with a simple tutorial or hints to do it. I am still beginner to this technology.
Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Looking at your requirements, it sounds like a third-party solution will be your best bet. Look into using something like CloudFlare. That will allow you to eliminate the hardware load balancer as a single point of failure. Since these seem not to be stactic sites, you’ll also need to set up the servers to replicate the database between them.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.