hdfs 复制因子 修改_如何设置HDFS目录的复制因子?

hdfs 复制因子 修改

Is it possible to set the replication factor for specific directory in HDFS to be one that is different from the default replication factor? This should set the existing files’ replication factors but also new files created in the specific directory.

是否可以将HDFS中特定目录的复制因子设置为与默认复制因子不同的复制因子? 这应设置现有文件的复制因子,还应设置在特定目录中创建的新文件。

This can simplify the administration. We can set the replication factor of /tmp/ to 2 and all new files and sub directories’ replication factors are 2 by default.

这样可以简化管理。 我们可以将/ tmp /的复制因子设置为2,默认情况下,所有新文件和子目录的复制因子为2。

There is a feature request but the feature is not yet available: https://issues.apache.org/jira/browse/HDFS-199

有一个功能请求,但该功能尚不可用: https : //issues.apache.org/jira/browse/HDFS-199

So, if all files in a dir like “/tmp/” are set to 2 replicas while the default is 3, the new files created in /tmp/ will still have 3 replicas.

因此,如果目录中的所有文件(如“ / tmp /”)均设置为2个副本,而默认值为3,则在/ tmp /中创建的新文件仍将具有3个副本。

To achieve the similar effect, you may need a daemon script to set the replication factors continuously like

为了达到类似的效果,您可能需要一个守护程序脚本来连续设置复制因子,例如

while true; do
    hdfs dfs -setrep -w 2 /tmp/
    sleep 30
done
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-set-replication-factors-for-hdfs-directories/

hdfs 复制因子 修改

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值