Hadoop伪分布式模式下所有核心的充分利用 [英] Full utilization of all cores in Hadoop pseudo-distributed mode

查看:30
本文介绍了Hadoop伪分布式模式下所有核心的充分利用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 4 核笔记本电脑上以伪分布式模式运行任务.如何确保所有内核都得到有效使用.目前,我的作业跟踪器显示一次只有一项作业正在执行.这是否意味着只使用了一个核心?

以下是我的配置文件.

conf/core-site.xml:

<预><代码><配置><财产><name>fs.default.name</name><value>hdfs://localhost:9000</value></属性></配置>

conf/hdfs-site.xml:

<预><代码><配置><财产><name>dfs.replication</name><值>1</值></属性></配置>

conf/mapred-site.xml:

<预><代码><配置><财产><name>mapred.job.tracker</name><value>localhost:9001</value></属性></配置>

根据答案,我需要在 mapred-site.xml 中添加以下属性

 <name>mapred.map.tasks</name><值>4</值></属性><财产><name>mapred.reduce.tasks</name><值>4</值></属性>

解决方案

mapred.map.tasksmapred.reduce.tasks 将控制这个,并且(我相信) 将在 mapred-site.xml 中设置.然而,这将这些设置为集群范围的默认值;更常见的是,您会在每个作业的基础上配置这些.您可以使用 -D

在 java 命令行上设置相同的参数

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?

The following are my configuration files.

conf/core-site.xml:

<configuration>
   <property>
       <name>fs.default.name</name>
       <value>hdfs://localhost:9000</value>
   </property>
 </configuration>

conf/hdfs-site.xml:

<configuration>
  <property>
       <name>dfs.replication</name>
       <value>1</value>
  </property>
</configuration>

conf/mapred-site.xml:

<configuration>
   <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9001</value>  
   </property>

</configuration>

EDIT: 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 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屋!

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