Tuesday, November 16, 2010

How to change replication factor of existing files in HDFS

By default, HDFS replicates each file 3 times. You can change the replication factor if desired. To set replication of an individual file to 4, run the following command
hadoop dfs -setrep -w 4 /path/to/file

To change replication of entire HDFS to 1:
hadoop dfs -setrep -R -w 1 /

No comments:

Post a Comment