Saturday, August 17, 2013

Exercise 5 (Part III): Investigation/Experiment on Heartbeat

For the first part of the investigation, we needed to repeat the process we did on our last exercise to set up heartbeat on two servers. When we remove the LAN cable on the primary server, here is what happen/the result when we used ping to test the set up.




Considering the first time result on each test, the average delay before the server responds is 0.7493 ms.

After getting the result for the first part of the investigation, we needed to add a server with heartbeat to be used for the second part. We had two secondary servers this time. When the LAN of the primary server was removed, one of the two secondary servers took over. The delay of the secondary server is  1.15ms.

When we removed the LAN of the slave server which responded earlier, the other/remaining slave server took over.





Exercise 5 (Part II): Server Backup

In our exercise, we were tasked to do a network configuration where a passive server backs up the active server whenever it is not available. We used three computers to accomplish this exercise: (1) an active server, (2) a passive server and (3) a client.

Here are the steps that we did:
1. We installed Heartbeat, Pacemaker and Apache to the computers who acted as servers.

2. We assigned a static IP address to each server:
     192.168.21.2 - active server
     192.168.21.3 - passive server

3. Next, we changed the hostname of the servers (server1 - active; server2 - passive) then edited /etc/hosts file:
   


192.168.21.1 is the cluster IP which will be accessed by the client.

4. We edited the configuration files of heartbeat for both servers:
     a. /etc/ha.d/authkeys
   
tells heartbeat to use the key #1 which is onethreeseven as md5 password

     b. /etc/ha.d/ha.cf


       c. /etc/ha.d/haresources

5. We started heartbeat on both servers using /etc/init.d/heartbeat command.
6. Finally, we tried if our set up worked.

We accessed 192.168.21.1 (cluster IP).
Then, we shutdown server1; server2 (192.168.21.3) took over.



Reference:
http://www.langeder.org/wordpress/high-available-server-using-heartbeat/
   

Monday, August 5, 2013

Exercise 5 (Part I): Introduction to Web Server, High-Availability and Cluster Resource Management

Web Server

Web server is an application which delivers web contents as they are requested. It uses a client-server model. Its main function is to provide web pages to clients using HTTP.

How does it work?
- When a web user requests a URL to be loaded, the web server fetches it then sends it to the user's browser.

Apache

Apache is an HTTP web server application that provides a full range of web server features. It is a free software distributed by Apache Software Foundation. It was originally designed for Unix environments, but has been eventually ported to Windows and other OS.

  • Installation
                  In Linux, just type sudo apt-get install apache2 on your terminal. Wait for it to be downloaded and installed.

  • Configuration
                  Once installed, look for httpd.conf (configuration file) in /etc/httpd/conf directory. Use a text editor to edit the file.

You may check if Apache is properly installed and configured by opening in a web browser the file index.html located at /var/www directory.


High Availability

It is a system or component that is continuously operational for a long period of time. This refers to the ability of system to be "100% operational" or "never-failing".

  • For a 3-year old child: A  girl broke or lost her favorite doll. She cried hard because it was really her favorite. To stop her from crying, her parents bought her another doll which looked like the same as the old one that the girl did not even mind.

Heartbeat
It is used to observe and manage the web servers. When the active server fails to deliver the web page a client has requested, another (passive) web server must take over. 
  • Installation
                  In Linux, just type sudo apt-get install heartbeat on your terminal. Wait for it to be downloaded and installed.

Cluster Resource Manager (Pacemaker)

It achieves maximum availability for your clusters services by detecting and recovering from node and resource-level failures by using the functions provided by a cluster infrastructure (example: Heartbeat).

References: