Can I have different block placement policies in HDFS?

偶尔善良 提交于 2020-07-20 04:29:24

问题


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?


回答1:


Yes, it is possible to do so.

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. SO post with the same problem: Modifying the block placement strategy of HDFS
  2. Another SO: how does hdfs choose a datanode to store
  3. Blog from 2009 when the feature was first released: HDFS block replica placement in your hands now!


来源:https://stackoverflow.com/questions/27992858/can-i-have-different-block-placement-policies-in-hdfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!