setrep

Changes the replication factor of a file.

If the specified path points to a directory, the command recursively changes the replication factor of all files under the specified directory. The EC files will be ignored when executing this command.

Returns 0 on success and -1 on error.

The usage is as follows:

$ hadoop fs -setrep [-R] [-w] <numReplicas> <path>
Arguments

-w

Requests the command to wait for the replication to complete. This can potentially take a very long time

-R

Accepted for the backward compatibility. It has no effect

Example:

$ hadoop fs -setrep -w 3 /user/hadoop/dir1
Found a mistake? Seleсt text and press Ctrl+Enter to report it