Integrating LVM with Hadoop and providing Elasticity to Data Node Storage

Integrating LVM with Hadoop and providing Elasticity to Data Node Storage

What is LVM?

In Linux, Logical Volume Manager is a device mapper framework that provides logical volume management for the Linux kernel. Most modern Linux distributions are LVM-aware to the point of being able to have their root file systems on a logical volume.

What is Elasticity in terms of Storage?

It refers to the capability of a storage system to adapt to variable workload changes by allocating and deallocating resources as required by each application.

What is Static or Fixed Partition?

This is the oldest and simplest technique used to put more than one processes in the main memory. In this partitioning, number of partitions (non-overlapping) in RAM are fixed but size of each partition may or may not be same. As it is contiguous allocation, hence no spanning is allowed. Here partition are made before execution or during system configure.

Problem Statement

?? 7.1: Elasticity Task

7.1.1 Integrating LVM with Hadoop and providing Elasticity to Data Node Storage

7.1.2 Increase or Decrease the Size of Static Partition in Linux.

Solution Steps

Task 7.1.1

Step 1:- CREATE PHYSICAL VOLUME. From the extra hard disks that you have attached.

No alt text provided for this image
No alt text provided for this image

Step 2:- CREATE VOLUME GROUP

No alt text provided for this image
No alt text provided for this image

Step 3:- CREATE LOGICAL VOLUME-

No alt text provided for this image
No alt text provided for this image

Step 4:- SHOW ALL THE LOGICAL VOLUME OF MY OS-

No alt text provided for this image

Step 5:- FORMAT THE LOGICAL PARTITION-

No alt text provided for this image

Step 6:- MOUNT

No alt text provided for this image

Partition is stored in the location /dev/mapper

No alt text provided for this image

Step 7:- Increase the size of LV

No alt text provided for this image

Use resize2fs command to format the extended portion of the LV

No alt text provided for this image

LVDISPLAY

No alt text provided for this image
No alt text provided for this image

Step 8:- NOW WE HAVE TO INTEGRATE WITH HADOOP. FOR THAT WE NEED TO CONFIGURE THE SYSTEM WHERE WE MADE A LOGICAL VOLUME AS A DATANODE , AND THE OTHER AS A MASTER.

HERE I HAVE CONFIGURED THE MASTER IN ANOTHER VM BY EDITING THE CONFIGURATION FILES: - hdfs-site.xml and core-site.xml , present in the /etc/hadoop directory.

No alt text provided for this image
No alt text provided for this image

Step 9:- CONFIGURE THE DATE NODE SIMILARLY

No alt text provided for this image

HERE THE DIRECTORY IN THE CONFIGURATION SHOULD BE SAME IN WHICH WE MOUNTED THE LVM , THAT IS /myfold.

No alt text provided for this image

Step 10:- FORMAT THE NAME NODE AND START IT

No alt text provided for this image
No alt text provided for this image

Step 11:- START THE DATA NODE

No alt text provided for this image

Step 12:- CHECK THE CLUSTER STATUS IN THE NAME NODE, WHERE WE WILL SEE THE CONTRIBUTED STORAGE OF DATA NODE TO THE CLUSTER.

No alt text provided for this image

Step 13:- NOW WE WILL INCREASE THE SIZE OF LVM AND CHECK IF IT IS REFLECTED IN THE HADOOP CLUSTER DETAILS.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

THE ABOVE PICTURE CLEARLY DEPICTS THAT AS WE INCREASED THE SIZE OF LVM IN THE DATA NODE, ITS CONTRIBUTED STORAGE TO THE CLUSTER ALSO INCREASES FROM 16 GB(approx.) TO 18 GB(approx.).

HENCE , INTEGRATION OF HADOOP AND LVM WAS SUCCESSFUL.

*******************************************************************************

SOLUTION STEPS

No alt text provided for this image

TASK 7.1.2

We can see available disks using command : #fdisk -l

No alt text provided for this image

Step 1:- Create static Partition of attached disk.

In my case I will create first partition of size 5GB on disk named /dev/sdb

steps for creating partition.

  1. fdisk /dev/sdb: to go inside the disk
  2. n : for new partition
  3. p : for primary partition
  4. w: to save the created partition.
No alt text provided for this image

Step 2:- Now format and mount the partition.

FORMAT

No alt text provided for this image

Then we will mount that formatted partition on the directory named /geetansh

No alt text provided for this image

Step 3:- Now we will create file in the created folder.

In this case , I have created file named spartition.txt inside the folder named geetansh.

No alt text provided for this image

Now let’s see how to increase the static partition

Step 4:- Increase the size of static partition

Unmount the partition

No alt text provided for this image

Delete the partition

d : it is for deleting partition

w : to save the changes

No alt text provided for this image

Step 5:- Create a new partition , format it and mount it on the directory geetansh

Create new partition

create new partition of size 7GB. We already formatted the partition1, now it is asking to remove or save the ext4 signature , in my case I am not removing the ext4 signature.

No alt text provided for this image

Here “N” is for don’t remove the ext4 signature.

and finally save the changes using #w

Now partition of 7gb is created.

No alt text provided for this image

Now format the extended part of partition.

  1. Examine filesystem for errors
No alt text provided for this image

2. Format the extended part :

No alt text provided for this image

Again Mount the created partitions on the same folder which we created previously

and after mounting partition check by using #df -h whether size has increased or not

In my case partition has mounted of size nearly about 7GB

No alt text provided for this image

Step 6:- Check if previously created file i.e. spartition.txt exists or not in the /geetansh directory.

No alt text provided for this image

Hence, we have increased the size of previously created static partitions without losing any data.

************************THANKS FOR READING**************************




要查看或添加评论,请登录

Geetansh Sharma的更多文章

社区洞察

其他会员也浏览了