简体   繁体   中英

HDFS set rep doesn't work

I have the following folder in HDFS: /data/2016/05/ 01 and also there are many files under this folder, I tried the following commands to set the rep=2.

hdfs dfs -setrep -w 2 /data/2016
hdfs dfs -setrep -R 2 /data/2016

but when I imported files to folder /data/2016/05/ 02 , the replication is still 3.

The replication setting on the file is set when it is created and does not change when moved around. If you want to set the replication to '2', do so when it is created ( FileSystem.setReplication or set dfs.replication via configuration ) OR, run hdfs dfs -setrep -R 2 /data/2016 after you have moved the file there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM