Monday, September 2, 2013

DRDB


PART I. MySQL and WebPage

The exercise is divided into two parts

A. Install PHP and MySQL
B. Create a simple webpage with 3 functionalities
    1. Sign In
    2. Sign Out
    3. Register

Task A.

Installing apache2: to install type sudo apt-get install apache2

Apache1

Apache2

Installing MySQL: to install type sudo apt-get install mysql-server. After installing test the mysql if it is working properly (see 4th picture)
MySQL 1

MySQL 2

MySQL 3

Creating table
Installing Php5: to install type sudo apt-get install php5 libapache2-mod-php5. After installing verify it through localhost. It can now successfully read .php files
Php 1


Php 2

Php 3

Task B.


In this task we are to create a simple web page. With the functionality given above. Here are the screenshots of the webpage. This was created using HTML 5, CSS and PHP.



Register Page
Sign In Page


Search Page
Search Result

Part 2. GParted and DRBD configuration.

A. GParted

GParted is a partitioning tool used to separate the hard disk into multiple spaces. I have used a different partition tool long time ago, but in essence what it does is it provides a separate storage.

For example:

We have hard drive capacity of 180GB, we can divide it into 3 parts, 80 GB for OS1 80 GB for OS2 and 20GB for the bootloading and other hardware files/configurations that are needed.

To configure

1. Open GParted. A prompt should appear asking for a password. (Type "user" in our case).


2. After opening we should see something like this.


3. To Configure
  3.1 Select an unallocated parition.
  3.2 Click New

  3.3 Set the New Size to 2056 MB ~ 2GB


  3.4 Click Add : after clicking add the partition should appear.


3.5 Apply : the changes you made would be useless unless you apply them. To apply go to
Edit->Apply All Operations.


Now you have successfuly created your own partition.

B. DRBD Configuration

1. Installation : DRBD is already installed
2. Configuration : 

2.1 Set up the two machines

We can do this by using the previous setup we have learned
* on terminal type hostname drbd-1 on server 1 and drbd-2 on server2
* edit /etc/hostnames, change it to drbd-1 and 2 accordingly
* assign a static ip on both machines. using ifconfig. assign 192.168.0.1 on server 1 and 192.168.0.2 on server 2
* edit /etc/hosts then include both machines with their respective IP's
* reboot
* configure /etc/drbd.conf


* start drbd if it returns an error that says no meta-data found type drbdadm create-md r0


Starting DRBDADM

Starting DRBD
* the partitioning of the other machine is not yet completed


No comments:

Post a Comment