如何限制mappers的数量 [英] how to limit the number of mappers

查看:389
本文介绍了如何限制mappers的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 conf.setNumMapTasks()显式地指定了我的java程序中的映射器数量,但是当作业结束时,计数器显示启动的映射任务的数量超过了规定值。如何限制映射器的数量到指定值?

解决方案

根据Hadoop API Jonf.setNumMapTasks 只是提示Hadoop运行时。 map任务的总数等于输入数据中要处理的块的数量。

虽然,应该可以配置map / reduce插槽的数量每个节点通过使用 mapred.tasktracker.map.tasks.maximum mapred.tasktracker.reduce.tasks.maximum 在mapred-site.xml中。通过这种方式,可以配置跨整个群集并行执行的映射器/减速器的总数。


I explicitly specify the number of mappers within my java program using conf.setNumMapTasks(), but when the job ends, the counter shows that the number of launched map tasks were more than the specified value. How to limit the number of mapper to the specified value?

解决方案

According to the Hadoop API Jonf.setNumMapTasks is just a hint to the Hadoop runtime. The total number of map tasks equals to the number of blocks in the input data to be processed.

Although, it should be possible to configure the number of map/reduce slots per node by using the mapred.tasktracker.map.tasks.maximum and the mapred.tasktracker.reduce.tasks.maximum in mapred-site.xml. This way it's possible to configure the total number of mappers/reducers executing in parallel across the entire cluster.

这篇关于如何限制mappers的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆