本文介绍了HDFS中可以有不同的块放置策略吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即一个具有多个应用程序的集群,每个集群对副本的位置都有不同的要求-我可以对其进行设置以支持这些多个应用程序吗?

I.e. one cluster that has multiple apps and each app has different requirements in terms of where copies are located - can I set it up so to support these multiple apps?

推荐答案

是的,可以这样做.

注意:后果自负.书写块放置策略极其复杂且具有风险.您的应用似乎需要确定代码副本的放置方式,这似乎是一种代码味道.考虑一下您是否真的需要编写块放置策略.警告过您之后,如果您想知道如何完成此操作,请继续.通常,此功能用于控制群集的平衡程度.例如.Hadoop供应商之一制定的策略之一是将块放置在磁盘使用率最低的磁盘上.

CAUTION: Proceed at your own risk. Writing block placement strategy is extremely complicated and risky. It's seems a code smell that your apps need to determine how replicas are placed. Think about if you really really need to write block placement strategies. Having warned you, proceed if you want to know how to accomplish this. Typically this feature is used to control how well balanced a cluster is. E.g. one of the strategies that was built by one of the Hadoop vendors is to place blocks on the disk with the lowest percentage disk used.

这里有很多资源供您查看:

Here's a bunch of resources for you to check out:

  1. 有同样问题的帖子:修改HDFS的块放置策略
  2. 另一种方法: hdfs如何选择要存储的数据节点
  3. 该功能于2009年首次发布时的博客:现在,HDFS可以将副本放置在您的手中!

这篇关于HDFS中可以有不同的块放置策略吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 16:28