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
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.
Tuesday, July 9, 2013
Domain Name server Configuration
Today I learned on how to ping host name in our domain
First We downloaded bind9 and edited files such as named.conf.local , db.192.168.2, and db bitwoel.com and also resolve.conf from the etc folder to specify the DNS server to use by the resolver
To check if my parameters are correct I used the command named-checkconf -z to check if my files created had any errors
and used named-checkzone bitwoel.com db.bitwoel.com
named-checkzone bitwoel.com db.192.168.2
from the etc/bind/ to check the validity of the zone file
We tested the dns server using the dig command to check the validity of the DNS server
And finally after everything check and done I pinged the other host names
Parts of the zone file:
The first line which depicts $TTL 86400 shows the default expiration time of all resource records without their own TTL value
Next the part "@ IN SOA"
The @ is a special notation that means origin
since the `domain' column for this file says 2.168.192.in-addr.arpa the first line really means "2.168.192.in-addr.arpa. IN SOA ... "
- reference:
Domain Names - Implementation and Specification, P. Mockapetris, (November 1987)
http://www.tldp.org/HOWTO/DNS-HOWTO-5.html July 9, 2013
First We downloaded bind9 and edited files such as named.conf.local , db.192.168.2, and db bitwoel.com and also resolve.conf from the etc folder to specify the DNS server to use by the resolver
To check if my parameters are correct I used the command named-checkconf -z to check if my files created had any errors
and used named-checkzone bitwoel.com db.bitwoel.com
named-checkzone bitwoel.com db.192.168.2
from the etc/bind/ to check the validity of the zone file
We tested the dns server using the dig command to check the validity of the DNS server
And finally after everything check and done I pinged the other host names
Parts of the zone file:
The first line which depicts $TTL 86400 shows the default expiration time of all resource records without their own TTL value
Next the part "@ IN SOA"
The @ is a special notation that means origin
since the `domain' column for this file says 2.168.192.in-addr.arpa the first line really means "2.168.192.in-addr.arpa. IN SOA ... "
The SOA describes where the zone comes from, which is responsible for it's contents and also the version of the zone file
- reference:
Domain Names - Implementation and Specification, P. Mockapetris, (November 1987)
http://www.tldp.org/HOWTO/DNS-HOWTO-5.html July 9, 2013
Tuesday, June 25, 2013
Exer 2 IP Routing
To start off with casual talk I had a fine day today with not much stress so I feel fine at the moment of my class.
Anyway The topic today was Ip routing where Sir Joman taught us a few Details and Current News Regarding IP addressing and also how to configure our computers IP Address.
I thougt it was gonna be hard to learn this new topic with all the new commands but with a steady pace of teaching thanks to sir Joman and Listening carefully to all the Instructions I was able to pull off the example to be done.
Since we couldn't actually communicate with another network (e.g. PC lab 8 and 9 will be connected). We will use a simulator made by Former Cmsc students here called Scalable Cisco IOS Simulator.The software can be downloaded from
http://jachermocilla.org/netsim-3.0.jar
The Software which we were using are courtesy of Michael B. Detras, Vincent B. Lee and Sir Ludwig Tirazona (my former lab instructor back from Cmsc 125)
The User Interface was alright, not too user friendly and not too techy... just the right mix for Cmsc students so it didn't take long for us to grasp its controls.
Basically what we did was connect a computer to a router and configure their IP addresses, Gateway and Mask.
Next up was the exercise which was more challenging than the example (should have seen that coming...) we were suppose to make a connection of 3 computers with only using a switch as a tip.
Here's an image of the connections. using 15 as the second number for all the router and computer names as my student number 2010-11703 adds up to it
Now it made me think how would I be able to do this but luckily I was able to notice a detail concerning the configuration of a static IP route (global) at the routers.
It turns out all I add to do was add all the IP routes that the current computer needs to communicate, do the same technique with the other Routers, and presto... I could Ping all of the Computers and Routers.
And with that the second exercise is done with a few time to spare :)
Anyway The topic today was Ip routing where Sir Joman taught us a few Details and Current News Regarding IP addressing and also how to configure our computers IP Address.
I thougt it was gonna be hard to learn this new topic with all the new commands but with a steady pace of teaching thanks to sir Joman and Listening carefully to all the Instructions I was able to pull off the example to be done.
Since we couldn't actually communicate with another network (e.g. PC lab 8 and 9 will be connected). We will use a simulator made by Former Cmsc students here called Scalable Cisco IOS Simulator.The software can be downloaded from
http://jachermocilla.org/netsim-3.0.jar
The Software which we were using are courtesy of Michael B. Detras, Vincent B. Lee and Sir Ludwig Tirazona (my former lab instructor back from Cmsc 125)
The User Interface was alright, not too user friendly and not too techy... just the right mix for Cmsc students so it didn't take long for us to grasp its controls.
Basically what we did was connect a computer to a router and configure their IP addresses, Gateway and Mask.
Next up was the exercise which was more challenging than the example (should have seen that coming...) we were suppose to make a connection of 3 computers with only using a switch as a tip.
Here's an image of the connections. using 15 as the second number for all the router and computer names as my student number 2010-11703 adds up to it
Now it made me think how would I be able to do this but luckily I was able to notice a detail concerning the configuration of a static IP route (global) at the routers.
It turns out all I add to do was add all the IP routes that the current computer needs to communicate, do the same technique with the other Routers, and presto... I could Ping all of the Computers and Routers.
And with that the second exercise is done with a few time to spare :)
Tuesday, June 18, 2013
First Exercise ExP
First post here in my blog and just finished my first exercise. It' very good that it was a lot easier to finish this exer than the exercises of cmsc subjects from previous years and its good to know that it won't be as hectic as them since there would less programming (Not that I don't like programming but it would be easier for me so I can focus on my other subjects mainly Cmsc 191 and 190-1).
I came to class a bit late since it was raining hard on that day and I didn't bring my umbrella and to top it up we are 22 in our section so since there wasn't enough Pc I'm using my own laptop. It was a nice beginning where I get to know again the people I've been classmates with since first year and I got know Sir Joman since this is the first time that he has been my teacher.
Here's the first screen shot required for the exer :)
though it was a rocky start for my exercise since my terminal wouldn't respond properly so I was a bit late in doing the exercise. By the way the exercise showed us how a network works with how we are able to chat and post message at our pc lab network.
Here I have successfully connected to the network
The command in the instructions were not so hard since we where taught about the in our previous subjects mainly Cmsc 124 and Cmsc 125 about the linux command and using secure shell for communication.
[rant] Nakaasar at pangalawang beses ko na tong itatype at biglang nagrefresh page [/rant]
I came to class a bit late since it was raining hard on that day and I didn't bring my umbrella and to top it up we are 22 in our section so since there wasn't enough Pc I'm using my own laptop. It was a nice beginning where I get to know again the people I've been classmates with since first year and I got know Sir Joman since this is the first time that he has been my teacher.
Here's the first screen shot required for the exer :)
though it was a rocky start for my exercise since my terminal wouldn't respond properly so I was a bit late in doing the exercise. By the way the exercise showed us how a network works with how we are able to chat and post message at our pc lab network.
Here I have successfully connected to the network
The command in the instructions were not so hard since we where taught about the in our previous subjects mainly Cmsc 124 and Cmsc 125 about the linux command and using secure shell for communication.
[rant] Nakaasar at pangalawang beses ko na tong itatype at biglang nagrefresh page [/rant]
Here's my login to the remote computer without using a password
Here's my first personal chat and write on wall with other users
And Lastly yes A password is required if I try to login for other workstations
Subscribe to:
Comments (Atom)