How to Get The Replication Factor of HDFS Files
There are two ways to get the replication factor of HDFS files.
Suppose we want to obtain the replication factor of the 2016 Olympic's Tweet dataset stored in /data/olympictweets2016rio. The first way would be to run the following command from your terminal:
As shown above, the replication factor is 10. However, in most cases, the default replication factor is 3.
The other way would be simply using hadoop fs -ls command. Just make sure you state the path of the dataset from which you want to obtain the replication factor.
The above command will be returning the information of the target directory or files. Have a look at the replication factor represented by the second column right after the permission part.
Both ways return the exact replication factor, which in this case is 10.
Komentar
Posting Komentar