Loadbalanced High-Availability

Discussion in 'HOWTO-Related Questions' started by satimis, Oct 18, 2010.

  1. satimis

    satimis Member

    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-server-ubuntu-10.10-maverick-meerkat-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-loadbalanced-ha-apache-cluster-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
     
  2. matty

    matty Member

    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.
    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. :)
     
  3. satimis

    satimis Member

    Hi matty,

    Thanks for your advice.

    Referring to;
    The UltraMonkey Solution;
    http://www.linuxvirtualserver.org/docs/ha/ultramonkey.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?


    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
     
    Last edited: Oct 18, 2010
  4. matty

    matty Member

    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.

    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.

    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.
     

Share This Page