How to select policy of block placement in the DataNode?

房东的猫 提交于 2020-01-07 05:54:10

问题


If the block replication is 3 in my hadoop cluster,and every DataNode has 3 ${dfs.data.dir} directories. When the DataNode is choosed to storage block, the block is storage in all 3 direcoties or one of them?

If the answer is latter, how to choose a ${dfs.data.dir} directory?


回答1:


The right directory is chosen on round robin manner when the block arrives to the datanode. You can alter this behavior by changing dfs.datanode.fsdataset.volume.choosing.policy to org.apache.hadoop.hdfs.server.datanode.fsdataset.AvailableSpaceVolumeChoosingPolicy, then the right directory would be chosen based on the space available in them (refer to configurations here: https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml)



来源:https://stackoverflow.com/questions/27057518/how-to-select-policy-of-block-placement-in-the-datanode

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