Jack
Jack

Reputation: 5890

Can Hdfs has different replication policy

Can I have different replication policy in different folder in HDFS? For example the files in folder /important_data I wanna that it's replicate is 3, but the files in folder /normal_data I just wanna it's replicate is 1. Thanks!

Upvotes: 0

Views: 40

Answers (1)

vgunnu
vgunnu

Reputation: 844

you can use setrep to set the replication

hadoop fs –setrep –w 3 -R /my/dir1
hadoop fs –setrep –w 1 -R /my/dir2

You set custom replication on file too.

hadoop fs –setrep –w 3 /my/file

Here is the documentation http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/FileSystemShell.html#setrep

Upvotes: 4

Related Questions