š Integrating LVM with Hadoop and providing Elasticity to DataNode Storage :
ā We will be using AWS for launching RHEL8 instance to setup Hadoop.
Task Requirement :
For some reason, we will be disabling SE-Linux in RHEL8:
#setenforce 0
#getenforce
Configuring hadoop cluster now :
ā”Master Node Configuration
šCreating directory in namenode
#mkdir /name1šConfiguring hdfs-site.xml
#vi hdfs-site.xml
<configuration>
<property>
<name>dfs.name.dir</name>
<value>/name1</value>
</property>
</configuration>
švi core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://<ip_of_master>:<custom_port></value>
</property>
</configuration>
Formatting namenode for first time:
#hadoop namenode -format
Starting NameNode:
#hadoop-daemon.sh start namenode
Listing connected data nodes:
#hadoop dfsadmin -report
ā”Slave Node Configuration:
Creating directory in slave node:
#mkdir /data2
Configuring hdfs-site.xml:
#vi hdfs-site.xml
<configuration>
<property>
<name>dfs.data.dir</name>
<value>/data2</value>
</property>
</configuration>
Configuring core-site.xml:
#vi core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://<ip_of_master>:<custom_port></value>
</property>
</configuration>
Starting data node:
#hadoop-daemon.sh start datanode
Listing connections with Master node:
#hadoop dfsadmin -report
š“Integrating LVM concept in Datanode
Attach EBS volume to this EC2 instance:
checking if the disk is attached or not :
#lsblk
#fdisk -l
āCreating Physical Volume :
#pvcreate <hdd-device>
#pvdisplay <hdd-device>
āCreating Volume Group:
#vgcreate <vg_name> <hdd-device>
#vgdisplay <vg_name>
āCreating Logical Volume :
#lvcreate --size +<value>G/M/K --name <lv_name> <vg_name>
#lvdisplay <vg_name>/<lv_name>
āFormating LV :
#mkfs.ext4 /dev/<vg_name>/<lv_name>
āMounting folder to LV:
#mount /dev/<vg_name>/<lv_name>
#df -h
Modified hdfs-site.xml in datanode:
āRestarting the Data node and listing the connected node:
#hadoop-daemon.sh start datanode
#hadoop dfsadmin -report
āExtending logical volume :
#lvextend --size +<value>G/M/K /dev/<vg_name>/<lv_name>
āResizing the logical volume
#resize2fs /dev/<vg_name>/<lv_name>
Size of the logical volume is increased now :
Checking if size is updated as in cluster or not
Thus , we have successfully integrated LVM with hadoop implementing concept of elasticity in datanodeā¦ā¦..
Keep sharing ā¦.
Happy learningā¦ā¦šš
Do check : Increasing or Decreasing the Linux static partition