Thursday, October 10, 2013

DRBD

For this week, we just created a simple website with basic functions like login, add user and logout.
This will  be needed for our exercise next week which is all about drbd.









For the next week, our task was to configure DRBD on our computers.  We  did that by first,  creating a new partition:



Then we modified our IP address from dynamic to static. Next is we put the localhost, server 1 & 2, and cluster's ip addresses on the /etc/hosts file  and installed DRBD.
After that we loaded the kernel module and configured the /etc/drbd.conf  file.

We tried to load the DRBD afterwards but we kept on  encountering an error. We tried figuring out the problem but we were  not able  to do that. Because of this, we did not finish entirely  the lasat exer on drbd.




High Availability Server


To configure a high availability server, we need to have the following configured:

Hearbeat  -  is a tool which provides cluster infrastructure. It is used to determine if a peer process fails to communicate so that its work can be done by another process.

Pacemaker -  by detecting and recovering from node and service-level failures, it achieves maximum availability for your cluster services.

Apache- or Apache HTTP Server, is an open-source web server application which provides tools for web server development.  It is supported on Linux, Windows and Mac.

In this exercise, the end user should not notice any failure on a particular website even there is really a failure behind the scene. There  will  be  an active and passive server. If the active server fails, the passive server should do  the job instead so that the process will continue.

Here are the steps to solve the problem:

1. First, make sure that the 3 tools are already  installed on your machine. Three computers are required to perform the exercise. Two  computers will be the server and the other one is the client.

2. Edit the Configuration files:

   Suppose our network is 192.168.0.1

for the hosts file,
/etc/hosts   should be

     127.0.0.1 localhost
     192.168.0.5     server1
     192.168.0.6     server2
     192.1168.0.24  cluster

for the authentication keys, 
/etc/ha.d/authkeys     should be

     1 md5 'yourpassword'

other configurations
edit /etc/ha.d/ha.cf
    logfacility local0 
    keepalive 2        
    deadtime 5        
    ping ipaddress   
    udpport 694       
    bcast eth0         
     node server1     
    node server2      
    auto fail_back2  


change the haresources - what will  be accessed by the client ( ipaddress)
edit /etc/ha.d/haresources

       server1 iPaddr::192.168.0.24/24/eth0 apache2

3. Start heartbeat by running:
     /etc/init.d/heartbeat start  or services heartbeat start

Results:


In this exercise, I learned to configure a simple high availability server. I will now think differently everytime I access a website like Facebook. I learned how can server failures be solved using HA server.

Internet Protocol Routing



IP Routing is the set of protocols  which resolves the path of data from the source to its destination.
One  program to simulate IP routing is the Scalable Cisco IOS Simulator for Virtual Machine.


In  this exercise, we need to connect 3 nodes or computers and determine if they can communicate which each other. After the exercise, the computer should have the capability of communicating with each other using the command 'ping'.


Here are the steps for solving the problem:

 network 1 will be 192.168.0.1
 network 2 will be 192.168.1.1
 network 3 will be 192.168.2.1

1. Make sure that you have a Network  Simulator installed on your machine. Launch the simulator to start.
2. We need 3 nodes/ host so we are going to click the computer monitor icon and generate 3 hosts by clicking and dragging it to the workspace.
3. Each computer/host needs identity so that it can be identified by other hosts. To do this, we should configure the IP  address, subnet mask and gateway of each host.
4. Configuration can be:
      Host 1 : 192.168.0.101, 255.255.255.0, 192.168.0.1
      Host 2:  192.168.1.101, 255.255.255.0, 192.168.1.1
      Host 3:  192.168.2.101, 255.255.255.0, 192.168.2.1

5. Next, we should generate 3 routers for each network and connect each host to  their respective network through the network interface ( eth#).

6 For the networks to communicate with each other,we will generate a switch. Connect the routers to the switch.

7. To test the network, open the terminal of a host and ping another host.

In this exercise, I have learned that for computers to interact with each other, IP, subnet, gateway should be configured. I have also learned that networks can communicate by connecting them using a switch.

Tuesday, June 18, 2013

Introduction to Data Communications and Networking




Communication is the exchange and transfer of ideas, information or thoughts to express, inform or influence. In computers, communication is done by sending and receiving information in the form of data through networks.


In our laboratory session, we were introduced to the basic concepts behind data communications and networking.




We were able to connect to a remote computer or server using Secure Shell (SSH).

  • Secure Shell is a network protocol for secured transactions or commands between computers connected to a network. This is a cryptographic protocol for secured data communications, remote command-line login and remote command execution
We were also able to use traditional username-password combination and public-private keys to access the remote server, configure a passwordless login or account and to communicate with other users that were also connected to the remote server.

Below is the step by step procedure on our first exercise about the lessons discussed.

First, I created my own user account on my workstation with my user-password combination.
This can be done by executing the command: 

$sudo adduser <username>


After that, I logged on to my account using the command $su <username>.
With my account on the remote server created by our instructor, I was able to connect to the remote computer with IP address "172.16.7.88" 


With SSH and the connection between my workstation and the remote computer, I was able to perform commands and manage data on the remote computer. But in every command performed, I'm always ask for my password. To avoid that, I configured my computer for passwordless login.

I terminated my connection with the remote computer and access my ".ssh" directory in my home folder.
After that, I generated a public key using these commands:

$ssh-keygen -t rsa
$<enter>
$<enter>
$<enter>


Then, I copied the generated public key (id_rsa.pub) to my .ssh/authorized_keys folder on the remote computer.
This can be done by executing the commands:

$scp id_rsa.pub username@172.16.7.88:~/.ssh/authorized_keys
or
$ssh-copy-id username@172.16.7.88

This time, it did not ask for my password when I logged on to the remote computer.


There were several workstations connected to the remote computer. We are taught of ways on how to communicate to other workstations.

Before we can broadcast messages, we should make sure that mesg is set to yes.
The command $mesg should output "is y".

To broadcast a message, the we can use any of the following commands:

$wall <<< "Message"
$echo "Message" | wall
$wall [filename]


To send a message to a certain workstation/user only, we can use the write command.
I asked for my partner's username which is mjimarinay. Then I executed this command:

$write mjimarinay [enter]
$"message"


Problem Encountered:
  • unstable network connection

After setting up passwordless login in my workstation to the  remote computer, I was asked for the password when I used my passwordless login to other workstation.