Hadoop single node 和 cluster 环境 对 MR 有什么影响?

2016-01-13 09:59:33 +08:00
 yuntong

最近在学 Hadoop,
问题 1: 我写 的 同一个 MR 在单节点 和 集群环境下是否会影响输出结果?

问题 2:mapper 的结果是如何对应到 不同的 reducer 的?(比如 我设置了 30 个 reducer)

这里好像有个 partition 的概念.
好像第一种是默认按照 哈希进行均匀的 分部到 reducer
第二种可以具体手动指定到分配到某个 reducer.
是不是这样?

因为 我的 电脑内存 等原因 还在用单节点 进行学习.

2524 次点击
所在节点    Hadoop
1 条回复
staticor
2016-01-19 13:25:55 +08:00
2. When there are multiple reducers, the map tasks partition their output, each creating one partition for each reduce task. There can be many keys (and their associated values) in each partition, but the records for any given key are all in a single partition. The partitioning can be controlled by a user-defined partitioning function, but normally the default partitioner -- which buckets keys using a hash function -- works very well.


刚刚看到这里, 回答一下问题 2 是的. 重写 partitioner.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/250345

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX