HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Loadbalanced High-Availability (http://www.howtoforge.com/forums/showthread.php?t=49522)

satimis 18th October 2010 08:35

Loadbalanced High-Availability
 
Hi folks,

Host - Ubuntu 1010 desktop 64 bit
VM - Ubuntu 1010 LAMP server 64 bit (w/o GUI)
virtualizer - Oracle VirtualBox

What I'm going to explore is as follows:-

Server-1 - LAMP, a working server on VM-1
Server-2 - LAMP, for redundancy on VM-2

While Server-1 is working all working data will be synchronized/duplicated on Server-2 simultaneously. When Server-1 is down for whatever cause the network will be switched automatically to Server-2. No interruption will be caused. Server-2 will continue to work. Then Server-1 can be repaired/upgraded/reconfigured etc.


I followed "The Perfect Server - Ubuntu 10.10 [ISPConfig 3]";
http://www.howtoforge.com/perfect-se...at-ispconfig-3

to install LAMP server on Server-1(VM-1). Just finished installation. I'm prepared to clone Server-1(VM-1) as Server-2(VM-2) and then to follow following link;

How To Set Up A Loadbalanced High-Availability Apache Cluster Based On Ubuntu 8.04 LTS
http://www.howtoforge.com/set-up-a-l...ter-ubuntu8.04

to proceed installing loadbalanced High Availability on the LAMP server.


I have following questions in doubt:-

1)
I only have 2 servers (VM-1 and VM-2) for the redundancy setup. Whether I must install 4 servers (4 VMs) to proceed.

2)
In case of only 2 servers (2 VMs) are required for my case whether I can clone Server-1(VM-1) as Server-2(VM-2)? OR Server-2(VM-2) must be a base server without Apache, MySQL, PHP, etc. installed?

Please shed me some light. TIA

B.R.
satimis

matty 18th October 2010 09:22

Quote:

Originally Posted by satimis (Post 242175)
1)
I only have 2 servers (VM-1 and VM-2) for the redundancy setup. Whether I must install 4 servers (4 VMs) to proceed.

To follow the method in the howto, you need 4 nodes (servers). You could get away with 3 if you didn't want redundancy for the load balancer.
Quote:

2)
In case of only 2 servers (2 VMs) are required for my case whether I can clone Server-1(VM-1) as Server-2(VM-2)? OR Server-2(VM-2) must be a base server without Apache, MySQL, PHP, etc. installed?
You can clone your completed server (obviously changing the necessary stuff, including your ssh private key).

The idea behind the howto is to have multiple cheap, replaceable web hosts at the back end. All run the same apps and have the same data (either replicated, or via a backend shared filesystem). In times of high load, you can easily deploy more nodes to add capacity, and redeploy them in quiet times. This is a great way to do it, as the nodes can be relatively inexpensive and as I say, it's easy to add capacity. The other way of having a highly available server is to make a failover cluster with shared filesystems. All the apps run on one big server, and in the case of failure, the disk is remounted on the standby server and it takes over. The downside is that you have a server sitting and waiting, generally doing nothing, and the only way to add capacity is to buy a bigger server (generally all servers need to be upgraded as they all need to be able to run the load by themselves).

You have a load balancer at the front end to direct traffic amongst the web servers. The howto also describes a method of providing a failover capability for the load balancer in case of failure or planned maintenance of the primary load balancer.

Hopefully that makes some sense. Have fun with your project. HA is an interesting area of system administration. :)

satimis 18th October 2010 18:34

Hi matty,

Thanks for your advice.

Quote:

Originally Posted by matty (Post 242180)
To follow the method in the howto, you need 4 nodes (servers).

Referring to;
The UltraMonkey Solution;
http://www.linuxvirtualserver.org/do...tramonkey.html

Still I can't understand why it needs 4 servers?

I suppose the 2 "Ultra Monkey (Linux Director+Backup)" represent Real Server 3. What does N on "Real Server N" represent? Whether in this example it is 4. Is it the number of servers on this setup? I can add more than 4 Real Servers?


Quote:

You could get away with 3 if you didn't want redundancy for the load balancer.
It is NOT difficult for me to clone 3 Real Servers. I need "REAL TIME" redundancy for the load balancer. But I'm not sure whether the 4 Real Servers need to be identical on packages installed?

Please advise. TIA

B.R.
satimis

matty 19th October 2010 09:12

Quote:

Originally Posted by satimis (Post 242231)
Referring to;
The UltraMonkey Solution;
http://www.linuxvirtualserver.org/do...tramonkey.html

Still I can't understand why it needs 4 servers?

I suppose the 2 "Ultra Monkey (Linux Director+Backup)" represent Real Server 3. What does N on "Real Server N" represent? Whether in this example it is 4. Is it the number of servers on this setup? I can add more than 4 Real Servers?

I think you might be not quite catching on to what is happening in that diagram, and in the original howto. The "real servers" are the application servers, such as webservers, that provide the content. Behind those can be servers that provide data storage and database functions if desired. The Real Server 1, Real Server 2, ... Real Server N means minimum of two real servers, up to any number of real servers. The reason you want a minimum of two real servers is because if you only had one real server, you wouldn't need a load balancer. So, that's two of the servers you need. The other two are for the load balancer (the LinuxDirector in the diagram) and it's Backup in case of failure. The load balancer has the IP address for the application you are serving (say, www.example.com). The real servers have the actual website for www.example.com. The load balancer gets the request from someone browsing the site, and connects it to one of the real servers. The next person that comes along gets connected to the other real server, and so on. This spreads the load amongst however many real servers you have. If the load balancer (LinuxDirector) fails, the standby load balancer (Backup in the diagram) takes over the IP address and things continue with a minimum of interruption.

Quote:

I need "REAL TIME" redundancy for the load balancer.
If you follow the guides, the loadbalancer will failover automatically in a small amount of time. It would be impossible to have no downtime, as the failure first has to be detected and then acted on, which will take a little time.

Quote:

But I'm not sure whether the 4 Real Servers need to be identical on packages installed?
It's best if the servers are configured the same way. Two for real servers and two for load balancing. There's no reason you couldn't create a basic VM as a template, clone that out, then configure the servers with whatever packages as necessary.


All times are GMT +2. The time now is 14:01.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.