在Hadoop伪分布式模式下充分利用所有内核 [英] Full utilization of all cores in Hadoop pseudo-distributed mode
问题描述
我在4核心笔记本电脑上以伪分布模式运行任务。我如何确保所有内核都得到有效使用。
目前我的作业跟踪器显示一次只能执行一个作业。这意味着只有一个核心使用?
I am running a task in pseudo-distributed mode on my 4 core laptop. How can I ensure that all cores are effectively used. Currently my job tracker shows that only one job is executing at a time. Does that mean only one core is used?
以下是我的配置文件。
conf / core- site.xml:
conf/core-site.xml:
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
conf / hdfs-site.xml:
conf/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
conf / mapred-site.xml:
conf/mapred-site.xml:
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
编辑:
根据答案,我需要在mapred- site.xml
As per the answer, I need to add the following properties in mapred-site.xml
<property>
<name>mapred.map.tasks</name>
<value>4</value>
</property>
<property>
<name>mapred.reduce.tasks</name>
<value>4</value>
</property>
推荐答案
mapred.map.tasks
和 mapred.reduce.tasks
会控制这个,并且(我相信)会在 mapred-site.xml中设置
。但是,这将它们确定为群集范围的默认值;更通常的情况下,你可以在每个作业的基础上进行配置。你可以用 -D
mapred.map.tasks
and mapred.reduce.tasks
will control this, and (I believe) would be set in mapred-site.xml
. However this establishes these as cluster-wide defaults; more usually you would configure these on a per-job basis. You can set the same params on the java command line with -D
这篇关于在Hadoop伪分布式模式下充分利用所有内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!