You can change the replication rate of a file using the command:
hdfs dfs –setrep –w 3 /user/hdfs/file.txt
You can also change the replication factor of a directory using the command:
hdfs dfs -setrep -R 2 /user/hdfs/test
But changing the replication rate for the directory only affects existing files, and new files in the directory will be created with the default replication rate ( dfs.replication from hdfs-site.xml) of the cluster.
For more information about him, see the link.
See the link for setting the replication rate for HDFS.
HDFS, :
-D dfs.replication=1
, Map/Reduce. .