To change directory replication ratio in hadoop

Is there a way to change the replication rate in a directory in Hadoop when I expect the change to apply to files that will be written to this directory in the future?

+4
source share
2 answers

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. .

+8

, , , HDFS Jira:

https://issues.apache.org/jira/browse/HDFS-199

, , , , -, . ( !) .

0

All Articles