Breaking News

Adding additional hard disk to the existing datanode

Adding additional Hard disk to the datanode

If suppose your disk in the datanode is full, you may either add a new datanode and run the balancer or you can add hard disk to the existing datanodes

Here I am going to explain the second method by adding the hard disk to the existing datanodes

OS:Ubuntu

Step 1: After attaching the hard disk, View All Existing Disk Partitions Using fdisk -l
# sudo fdisk -l
You should be able to see the newly added disk.

Step 2 : You need to format the newly added disk.
Ex. # sudo mkfs.ext3 /dev/sdb2

Step 3: Need to create the directory in which the newly added disk need to mount

Ex.# sudo mkdir -p /media/New/hdfs/data

Step 4: Mount the drive to the directory

Ex. # sudo mount /dev/sdb2 /media/New/hdfs/data

Step 5: Assign enough permission and assign the owner

Ex. # sudo chmod -R 755 /media/New/hdfs/data
    # sudo chown -R user:user /media/New/hdfs/data

Step 6: In the hdfs-site.xml add the new mount point for the dfs.data.dir with comma separated.

Ex.:    <property>
             <name>dfs.data.dir</name>
             <value>/hadoop/hdfs/data,/media/New/hdfs/data</value>
         </property>

Step 7: Stop and start the datanode
In case, if its a cluster and you have added the hard disk for every node then restart the dfs.

1 comment: