简体   繁体   English

HDFS设置代表不起作用

[英]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中有以下文件夹:/ data / 2016/05/01,并且此文件夹下还有很多文件,我尝试了以下命令来设置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. 但是当我将文件导入文件夹/ data / 2016/05/02时 ,复制仍为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. 如果要将复制设置为“ 2”,请在创建复制时将其设置为“ FileSystem.setReplication或通过配置设置dfs.replication”,或者在移动文件后运行hdfs dfs -setrep -R 2 /data/2016那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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