A related question: how to find the replication factors of files in a HDFS cluster?
method 1: You can use the HDFS command line to
ls the file.
The second column of the output will show the replication factor of the file.
$ hdfs dfs -ls /usr/GroupStorage/data1/out.txt -rw-r--r-- 3 hadoop zma 11906625598 2014-10-22 18:35 /usr/GroupStorage/data1/out.txt
The out.txt’s replication factor is 3.
Using the above file as an example:
$ hdfs dfs -stat %r /usr/GroupStorage/data1/out.txt
It will print