HDFS - Hadoop Distributed File System

You are currently auditing this course.
50 / 58

HDFS - Hands-On - More Commands




Not able to play video? Try with youtube

To access the files in HDFS, we can type any of the commands displayed on the screen.

To see which datanodes have blocks of sample.txt, use the following command:

hdfs fsck -blocks -locations -racks  -files /data/mr/wordcount/input/big.txt

Blocks are located on datanodes having private ips 10.142.1.2, 10.142.1.1, 10.142.1.4 and 10.142.1.3

By default, Every file is having a replication factor of 3 on CloudxLab. To change the replication factor of sample.txt to 1, we can run

hadoop fs -setrep -w 1 /user/abhinav9884/sample.txt

Now if we check the blocks, we will see that the Average block replication is 1. If you want to increase your space quota on HDFS, please decrease the replication factor of your home directory in HDFS


Loading comments...