Sad to say we were not able to finish setting up and configuring DRBD with heartbeat to work due to heartbeat acting up. However if it did work the steps we would have likely done and followed would be based from our previous exercises
The same prerequisites should be done here like the previous exercise in setting up DRBD and heartbeat
check
http://zeroliken.blogspot.com/2013/09/drbd.html
http://zeroliken.blogspot.com/2013/08/server-backup-using-heartbeat-and-apache.html
Next step would be to setup the two computer that will act as a database for access then configure MySQL
If we were to be able to do this exercise then we can only have one computer to act as a database while the others can try to access it
CMSC 137 Blog
Thursday, October 10, 2013
DRBD Investigation
Today we learn about DRBD and how to use them (to start with)
The best resource to learn about it is from their main website http://www.drbd.org/
DRBD (Distributed Replicated Block Device) is a scheme for distributed replicated storage for the GNU/Linux platform. It is implemented as several userspace management applications and some shell scripts and is normally used on high availability (HA) clusters.
DRBD® refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.
A DRBD is essentially workload agnostic. A DRBD can be used as the basis of:
To install DRBD we open a terminal and type the command:
Then we configured DRBD by editing drbd.conf in the etc folder. This file should be the same on the servers.
In order to setup the DRBD then you must have installed Gparted to create a new partition. Usually Gparted is already installed on most linux based distros, if not then we open a terminal and use the command
References:
http://www.drbd.org/
http://www.drbd.org/users-guide/ch-ocfs2.html
The best resource to learn about it is from their main website http://www.drbd.org/
DRBD (Distributed Replicated Block Device) is a scheme for distributed replicated storage for the GNU/Linux platform. It is implemented as several userspace management applications and some shell scripts and is normally used on high availability (HA) clusters.
DRBD® refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.
A DRBD is essentially workload agnostic. A DRBD can be used as the basis of:
- A conventional file system,
- a shared disk file system such as GFS2 or OCFS2,
- another logical block device (as used in LVM, for example),
- any application requiring direct access to a block device
in our exercise we setup and install the following:
- apache2
- php5
- mysql
- php5-mysql
We open a terminal and type in the following commands toinstall them
apt-get install apache2
apt-get install php5
apt-get install mysql-server mysql-client mysql-common
apt-get install php5-mysql
To install DRBD we open a terminal and type the command:
sudo apt-get install drbd8-utils
Then we configured DRBD by editing drbd.conf in the etc folder. This file should be the same on the servers.
In order to setup the DRBD then you must have installed Gparted to create a new partition. Usually Gparted is already installed on most linux based distros, if not then we open a terminal and use the command
sudo apt-get install gparted
References:
http://www.drbd.org/
http://www.drbd.org/users-guide/ch-ocfs2.html
Wednesday, October 9, 2013
Investigation on Webserver (Apache) and High Availability
Research on the following topics:
1. Apache
A web server application that is developed and maintained by an open community of developers under the supervision of the Apache Software Foundation. Apache became became the dominant web Server by 2009
Some notable Apache files used for configuration are:
which should show the following
2. High availability
high availability refers to a system that is continuously operational for a desirably long length of time or a system that can be continuously be used over a long period of time.
One example is the service provided by websites needs to have high availability for clients to continuously use the services offered from the website they are currently using. This can be achieved by multiple servers where a working server will take on the role of a failed server.
Heartbeat is a daemon that provides cluster infrastructure services to its clients. This allows clients to know whether the peer processes on other machines are working or not and easily exchange messages with them.
Installing and Configuring Heartbeat
To install Heartbeat in Ubuntu open a terminal and type
sudo apt-get install heartbeat-2
Heartbeat config files are stored in /etc/heartbeat/
Configuration Files
Imagine having a set of different beverages (e.g. milk, chocolate, orange): if one drink is unavailable to use you can use the other beverages to satisfy your thirst in place of the unavailable one
References:
http://www.apache.org/
http://searchdatacenter.techtarget.com/definition/high-availability
http://i.technet.microsoft.com/dynimg/IC166357.gif
https://help.ubuntu.com/10.04/serverguide/httpd.html
http://linux-ha.org/wiki/Heartbeat
1. Apache
A web server application that is developed and maintained by an open community of developers under the supervision of the Apache Software Foundation. Apache became became the dominant web Server by 2009
In order to install Apache on Ubuntu open a terminal then use the following command
sudo apt-get install apache2
- apache2.conf: the main Apache2 configuration file. Contains settings that are global to Apache2.
- conf.d: contains configuration files which apply globally to Apache2. Other packages that use Apache2 to serve content may add files, or symlinks, to this directory.
- httpd.conf: historically the main Apache2 configuration file, named after the httpd daemon. The file can be used for user specific configuration options that globally effect Apache2.
which should show the following
2. High availability
high availability refers to a system that is continuously operational for a desirably long length of time or a system that can be continuously be used over a long period of time.
One example is the service provided by websites needs to have high availability for clients to continuously use the services offered from the website they are currently using. This can be achieved by multiple servers where a working server will take on the role of a failed server.
Heartbeat is a daemon that provides cluster infrastructure services to its clients. This allows clients to know whether the peer processes on other machines are working or not and easily exchange messages with them.
Installing and Configuring Heartbeat
To install Heartbeat in Ubuntu open a terminal and type
sudo apt-get install heartbeat-2
Heartbeat config files are stored in /etc/heartbeat/
Configuration Files
- ha.cf - tells Heartbeat what types of media paths to use and how to configure them
- haresources - list of resources that moves to machine to machine as nodes and come up in the cluster. This file must be the same on both nodes.
- authkeys - contains an auth directive with an associated method ID number, and there is a line that has the authentication method and the key that go with the ID number of the auth directive. Must be owned by root and be chmod 600.
Imagine having a set of different beverages (e.g. milk, chocolate, orange): if one drink is unavailable to use you can use the other beverages to satisfy your thirst in place of the unavailable one
References:
http://www.apache.org/
http://searchdatacenter.techtarget.com/definition/high-availability
http://i.technet.microsoft.com/dynimg/IC166357.gif
https://help.ubuntu.com/10.04/serverguide/httpd.html
http://linux-ha.org/wiki/Heartbeat
Thursday, September 5, 2013
Setting up DRBD
Here we use 2 computers running on ubuntu 12.04 to act as servers in setting up the drbd
Server 1 Configuration

Using Gparted to create a partition with unknown filesystem type
Next we follow the steps exactly stated at http://www.howtoforge.com/setting-up-network-raid1-with-drbd-on-ubuntu-11.10 in order to setup the system
Next we follow the steps exactly stated at http://www.howtoforge.com/setting-up-network-raid1-with-drbd-on-ubuntu-11.10 in order to setup the system
Server 1 and server 2 drbd.conf configuration and etc/hosts config
Creating test files to be viewed by server 2
References:
http://www.howtoforge.com/setting-up-network-raid1-with-drbd-on-ubuntu-11.10
Monday, August 12, 2013
HeartBeat Investigation
Questions to ponder:
1. After setting up two servers with heartbeat, use ping/apache to test the setup, remove the LAN cable on the primary server then observe what will happen and what is the average delay before the service responds again. (You need to get the average so you need to test the setup at least thrice). What value on the ha.cf matched or is near on the result of your investigation?
ScreenShots for the first 2 servers
2. Setup three to four servers with heartbeat on each server. The set up must have a primary server and the rest are secondary/slave servers. Remove the LAN cable on the primary server, what will happen next. Also observe the response time of the secondary server.
3. From your latest set up, remove the LAN Cable from the slave that responded earlier and observe what will happen
Some more screenshots
The average delay time before the service responds for all servers is about 0.948 for the three servers, with each of the servers when removing the LAN the server responds a bit slower in comparison with the primary server
1. After setting up two servers with heartbeat, use ping/apache to test the setup, remove the LAN cable on the primary server then observe what will happen and what is the average delay before the service responds again. (You need to get the average so you need to test the setup at least thrice). What value on the ha.cf matched or is near on the result of your investigation?
ScreenShots for the first 2 servers
2. Setup three to four servers with heartbeat on each server. The set up must have a primary server and the rest are secondary/slave servers. Remove the LAN cable on the primary server, what will happen next. Also observe the response time of the secondary server.
3. From your latest set up, remove the LAN Cable from the slave that responded earlier and observe what will happen
Some more screenshots
The average delay time before the service responds for all servers is about 0.948 for the three servers, with each of the servers when removing the LAN the server responds a bit slower in comparison with the primary server
Server Backup using Heartbeat and Apache
In our exercise we needed to setup a network configuration where one server will take the role of the other server whenever it is unavailable
First we installed the following application using ubuntu
Apache
Heartbeat
Pacemaker
with the use of the apt-get install command of ubuntu
Next we use three computers, the first two will act as a server while the third one will be the client that will connect to a server
first we set Server 1&2 file “/etc/hosts” with the following:
127.0.0.1 localhost
192.168.1.2 server2
192.168.1.1 server1
192.168.1.3 cluster
next edit “/etc/ha.d/authkeys”
auth 1
1 md5 onethreeseven
and we made it unreadable for non-root users:
chmod 0600 /etc/ha.d/authkeys
Then we edit “/etc/ha.d/ha.cf” to look similar like this one:
logfacility local0 #used to tell heartbeat which log facility to utilize for logging
keepalive 2 #interval between heartbeat packets currently every 2 secs you could also use 2000ms
deadtime 5 # timeout before the other server takes over
ping 192.168.1.2 #address to ping to determine if we are alive
udpport 694 #port to listen in on for broadcasts made by heartbeat
bcast eth1 #device to use for broadcasts
node server1 # hostname of one of our two nodes
node server2 # hostname of other of our two nodes
auto_failback on # very important or auto failover won't happen
This is the config for server 1, 192.168.1.2 is the address of server 2.
You have to place the IP of server1 in the file on server2 too.
Then duplicate we “/etc/ha.d/haresources” and “/etc/ha.d/authkeys” to server2.
Finally, start Heartbeat on both Servers:
/etc/init.d/heartbeat start
References:
http://www.langeder.org/wordpress/high-available-server-using-heartbeat/
First we installed the following application using ubuntu
Apache
Heartbeat
Pacemaker
with the use of the apt-get install command of ubuntu
Next we use three computers, the first two will act as a server while the third one will be the client that will connect to a server
first we set Server 1&2 file “/etc/hosts” with the following:
127.0.0.1 localhost
192.168.1.2 server2
192.168.1.1 server1
192.168.1.3 cluster
next edit “/etc/ha.d/authkeys”
auth 1
1 md5 onethreeseven
and we made it unreadable for non-root users:
chmod 0600 /etc/ha.d/authkeys
Then we edit “/etc/ha.d/ha.cf” to look similar like this one:
logfacility local0 #used to tell heartbeat which log facility to utilize for logging
keepalive 2 #interval between heartbeat packets currently every 2 secs you could also use 2000ms
deadtime 5 # timeout before the other server takes over
ping 192.168.1.2 #address to ping to determine if we are alive
udpport 694 #port to listen in on for broadcasts made by heartbeat
bcast eth1 #device to use for broadcasts
node server1 # hostname of one of our two nodes
node server2 # hostname of other of our two nodes
auto_failback on # very important or auto failover won't happen
This is the config for server 1, 192.168.1.2 is the address of server 2.
You have to place the IP of server1 in the file on server2 too.
Then duplicate we “/etc/ha.d/haresources” and “/etc/ha.d/authkeys” to server2.
Finally, start Heartbeat on both Servers:
/etc/init.d/heartbeat start
/etc/ha.d/authkeys
/etc/ha.d/ha.cf
/etc/ha.d/haresources
/etc/hosts
References:
http://www.langeder.org/wordpress/high-available-server-using-heartbeat/
Monday, July 29, 2013
DHCP and Telnet
Before the start of the exercise we were grouped in pairs or threes where a person will configure their PC/ linux box to allow the other person's PC (computer A) to connect to the internet via computer B, meaning act as a router and DHCP server.
Here we set the appropriate firewall settings of Computer B
Here we used the the interface names that correspond to the NICS
The exercise was to allow the connecting PC to automatically configure their every time it connects to our network. That is without manually copying the contents of etc/resolv.conf from our PC to his
We editted the file dhcpd.conf and added the lines
default-lease-time 600;
max-lease-time 7200;
option domain-name "intranet.uplb.edu.ph";
option domain-name-servers 172.16.1;
these are global parameters that defines the domain name and addresses of the main server which is present in our etc/resolv.conf file
which allowed Computer A's resolv.conf file to be automatically editted with the following domain name and address of the main server
To show that Computer B is configured properly we use the command
cat /var/lib/dhcp3/dhcpd.leases
to view the lease file which contain the IP addresses currently on lease by the DHCP server
Telnet:
The last thing we did was to use the Hypertext transfer protocol using the command
$telnet www.google.com 80
GET /search?=joseph+hermocilla
which to our dismay didn't work as intended as we keep receiving an error message from the browser, after a bit of research from stackoverflow.com we found out the we need a complete address to get the search results which is
GET http://www.google.com/search?q=joseph+hermocilla HTTP/1.0
Answers:
1. iptable command parameters and their descriptions:
-F used to flush the selected chain and delete all the previous rules one by one
-P sets the policy for the given target
ACCEPT means let the packet through
INPUT for packets destined to local sockets
FORWARD for packets being routed through the box
OUTPUT for locally-generated packets
-t This option specifies the packet matching table which the command should operate on.
nat This table is consulted when a packet that creates a new connection is encountered
-A Append one or more rules to the end of the selected chain
POSTROUTING for altering packets as they are about to go out
-o Name of an interface via which a packet is going to be sent
-j This specifies the target of the rule; i.e., what to do if the packet matches it.
MASQUERADE This target is only valid in the nat table, in the POSTROUTING chain.
2.Options used in the etc/dhcpd.conf are the domain-name and domain-name-server
3. To assign a fixed static IP address you need the ff. information:
IP address, netmask, network address, broadcast and gateway.
Subscribe to:
Comments (Atom)