Win7下无法提交MapReduce Job到集群环境(转)

一. 对hadoop eclipse plugin认识不足

http://zy19982004.iteye.com/blog/2024467曾经说到我最hadoop eclipse plugin作用的认识。但事实上我犯了一个错误,Win7 Eclipse里的MyWordCount程序一直在本地运行,没有提交到集群环境上运行(查看192.168.1.200:50030)没有这个Job。运行方式分为两种,右键Run As

  1. Java Application
  2. Run on Hadoop

如果说Run As Java Application在本地运行还好说,它直接使用项目下的依赖的Hadoop Jar,使用Hdfs作为input,对MyWordCount main方法的一步步调用,把输出结果写入Hdfs完成。这一切都跟MapReduce集群无关。

但Run on Hadoop为什么不行呢,难道这个插件的作用仅仅如http://zy19982004.iteye.com/blog/2024467说到的这么简单?

二. Hadoop2.x eclispe-plugin

再次下载源码https://github.com/winghc/hadoop2x-eclipse-plugin。简单看了几个类,如

Java代码  

  1. Wizard for publishing a job to a Hadoop server
  2. public class RunOnHadoopWizard extends Wizard {}
  3. Representation of a Map/Reduce running job on a given location
  4. public class HadoopJob {}

从注释就可以看出来插件是支持远程提交Job的。那是我使用不当吗?

三. Hadoop2.x eclispe-plugin工作原理

Run on Hadoop时

  1. 会在EclipseWorkspace\.metadata\.plugins\org.apache.hadoop.eclipse\下生成一个MapReduce Jar和一个对应文件夹(包含core-site.xml)。我们在Eclipse里配置的Hadoop集群信息会写到core-site.xml里面。
  2. 然后把此Job依据配置信息提交到本地或者集群。

我去看了下Job对应的core-site.xml,mapreduce.framework.name居然是local,yarn.resourcemanager.address居然是0.0.0.0:8032,于是回到Eclispe配置集群环境的地方,发现果然是这样的,也就是说插件根本没有把集群环境下的配置信息全部copy到Eclipse下。把Eclipse下这两项修改后,还是在本地运行,我就奇怪了,于是我在程序里加上

Java代码  

  1. conf.set("mapreduce.framework.name", "yarn");
  2. conf.set("yarn.resourcemanager.address", "192.168.1.200:8032");

终于正常提交到集群环境了。我怀疑插件最后在什么地方还是读取到了local和0.0.0.0:8032,写入了core-site.xml,有时间再去看看插件的源码。

四. 继续出问题

Job虽然是提交到了集群环境,但运行失败了。查看日志如下

Java代码  

  1. 2014-04-01 19:50:36,731 INFO org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncher: Command to launch container container_1396351641800_0005_02_000001 :
  2. %JAVA_HOME% -Dlog4j.configuration=container-log4j.properties -Dyarn.app.container.log.dir=<LOG_DIR> -Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA  -Xmx1024m org.apache.hadoop.mapreduce.v2.app.MRAppMaster 1><LOG_DIR>/stdout 2><LOG_DIR>/stderr
  3. 2014-03-13 22:50:41,317 INFO  org.apache.hadoop.mapreduce.Job - Job job_1394710790246_0003 failed with state FAILED due to: Application application_1394710790246_0003 failed 2 times due to AM Container for appattempt_1394710790246_0003_000002 exited with  exitCode: 1 due to: Exception from container-launch:
  4. org.apache.hadoop.util.Shell$ExitCodeException: /bin/bash: line 0: fg: no job control
  5. at org.apache.hadoop.util.Shell.runCommand(Shell.java:464)
  6. at org.apache.hadoop.util.Shell.run(Shell.java:379)
  7. at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
  8. at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
  9. at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
  10. at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:79)
  11. at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
  12. at java.util.concurrent.FutureTask.run(FutureTask.java:166)
  13. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
  14. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
  15. at java.lang.Thread.run(Thread.java:722)

上网找答案,发现是Hadoop本身的问题。

https://issues.apache.org/jira/browse/YARN-1298

https://issues.apache.org/jira/browse/MAPREDUCE-5655

五. 自己编译Hadoop2.2

  1. 下载Hadoop2.2源码http://apache.fayea.com/apache-mirror/hadoop/common/hadoop-2.2.0/hadoop-2.2.0-src.tar.gz
  2. 下载https://issues.apache.org/jira/i#browse/MAPREDUCE-5655两个patch
  3. 下载https://issues.apache.org/jira/i#browse/HADOOP-10110这个patch
  4. patch指令。patch -p0 < MRApps.patch。p0的0代表进去层次。不会的参考http://hi.baidu.com/thinkinginlamp/item/0ba1d051319b5ac09e2667f8
  5. 然后按照http://my.oschina.net/yiyuqiuchi/blog/188510去编译。hadoop-2.2.0-src/hadoop-dist/targethadoop-2.2.0.tar.gz就是编译好的。

给两张patch前后的对照图

下图左边为patch前Hadoop源码

下图左边为patch成功后Hadoop源码

六. 使用自己编译的包

  1. 检查看看patch是否被打包进去了。通过查看MRApps.class字节码得知已经被打包进去。通过查看YARNRunner.class字节码也是正确的,我在YARNRunner.java里面设置了一个PATCH_TEST编译时常量,"zy19982004"的字节码已经被内嵌到class的字节码里。
  2. 替换集群Jar,因为上述三个patch只涉及到两个Jar,另外一个pacth是修改pom文件并且是scope test,可以不管。用hadoop-2.2.0\share\hadoop\mapreduce\hadoop-mapreduce-client-common-2.2.0.jar(MRApps.patch)替换集群下的对应jar,用hadoop-2.2.0\share\hadoop\mapreduce\hadoop-mapreduce-client-jobclient-2.2.0.jar(YARNRunner.patch)替换集群下的对应jar。
  3. 修改windows环境下的mapred-site.xml,添加

    Java代码  

    1. <property>
    2. <name>mapred.remote.os</name>
    3. <value>Linux</value>
    4. <description>Remote MapReduce framework‘s OS, can be either Linux or Windows</description>
    5. </property>
  4. 重启集群,这个错误已经没有了,但出现了另外的错误。

    Java代码  

    1. Application application_1396339724108_0014 failed 2 times due to AM Container for appattempt_1396339724108_0014_000002 exited with exitCode: 1 due to: Exception from container-launch:
    2. org.apache.hadoop.util.Shell$ExitCodeException:
    3. 2014-04-01 19:50:36,731 INFO org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncher: Command to launch container container_1396351641800_0005_02_000001 :
    4. $JAVA_HOME/bin/java -Dlog4j.configuration=container-log4j.properties -Dyarn.app.container.log.dir=<LOG_DIR> -Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA  -Xmx1024m org.apache.hadoop.mapreduce.v2.app.MRAppMaster 1><LOG_DIR>/stdout 2><LOG_DIR>/stderr

    然后

    Java代码  

    1. 1) Add such config property to your mapred-site.xml (client side only):
    2. <property>
    3. <name>mapreduce.application.classpath</name>
    4. <value>
    5. $HADOOP_CONF_DIR,
    6. $HADOOP_COMMON_HOME/share/hadoop/common/*,
    7. $HADOOP_COMMON_HOME/share/hadoop/common/lib/*,
    8. $HADOOP_HDFS_HOME/share/hadoop/hdfs/*,
    9. $HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*,
    10. $HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*,
    11. $HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*,
    12. $HADOOP_YARN_HOME/share/hadoop/yarn/*,
    13. $HADOOP_YARN_HOME/share/hadoop/yarn/lib/*
    14. </value>
    15. </property>

    终于成功了。。。

七. 不使用hadoop eclispe plugin的场景

自己调试Hadoop源码的时候,Debug As Java Application即可。前面两篇博客解决错误都是通过debug源码来解决的。

八. 总结

Window向Linux Hadoop提交作业的方法

  1. 配置好hadoop eclipse plugin。
  2. Job配置文件里mapreduce.framework.name为yarn。其它配置也需要正确。
  3. Run On Hadoop

Run As Application其实也可以提交Job,依赖于上一次Run on Hadoop过程中产生的jar,这为我们debug提供了一种思路。

4 

0 

分享到:  

Hadoop学习三十三:Hadoop-HBase Bulk Load ... | Hadoop学习三十一:Win7下HBase与MapReduc ...

评论

11 楼 zy19982004 2014-12-22   引用

,

songyuejs 写道

楼主,我按照你的帖子一步一步改到最后,结果还是有错误。我发现作业提交成功了,可是运行出现如下错误: 
2014-12-18 17:37:23,630 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Before Scheduling: PendingReds:1 ScheduledMaps:2 ScheduledReds:0 AssignedMaps:0 AssignedReds:0 CompletedMaps:0 CompletedReds:0 ContAlloc:0 ContRel:0 HostLocal:0 RackLocal:0 
2014-12-18 17:37:23,653 ERROR [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: ERROR IN CONTACTING RM. 
java.io.IOException: org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException: Invalid resource request, requested memory < 0, or requested memory > max configured, requestedMemory=-1, maxMemory=8192 
        at org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.validateResourceRequest(SchedulerUtils.java:198)
        at org.apache.hadoop.yarn.server.resourcemanager.RMServerUtils.validateResourceRequests(RMServerUtils.java:78) 
        at org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService.allocate(ApplicationMasterService.java:394)
        at org.apache.hadoop.yarn.api.impl.pb.service.ApplicationMasterProtocolPBServiceImpl.allocate(ApplicationMasterProtocolPBServiceImpl.java:60)
        at org.apache.hadoop.yarn.proto.ApplicationMasterProtocol$ApplicationMasterProtocolService$2callBlockingMethod(ApplicationMasterProtocol.java:99)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585) 
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928) 
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2048) 
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2044) 
        at java.security.AccessController.doPrivileged(Native Method) 
        at javax.security.auth.Subject.doAs(Subject.java:415) 
能帮我看看是为什么吗,这种错误我在网上没看到过,真不知道怎么解决,谢谢了

/** 
   * Utility method to validate a resource request, by insuring that the 
   * requested memory/vcore is non-negative and not greater than max 
   * 
   * @throws <code>InvalidResourceRequestException</code> when there is invalid 
   *         request 
   */ 
  public static void validateResourceRequest(ResourceRequest resReq, 
      Resource maximumResource) throws InvalidResourceRequestException { 
    if (resReq.getCapability().getMemory() < 0 || 
        resReq.getCapability().getMemory() > maximumResource.getMemory()) { 
      throw new InvalidResourceRequestException("Invalid resource request" 
          + ", requested memory < 0" 
          + ", or requested memory > max configured" 
          + ", requestedMemory=" + resReq.getCapability().getMemory() 
          + ", maxMemory=" + maximumResource.getMemory()); 
    }

你可以自己看看源代码   为什么resReq.getCapability().getMemory()= -1

10 楼 songyuejs 2014-12-18   引用

楼主,我按照你的帖子一步一步改到最后,结果还是有错误。我发现作业提交成功了,可是运行出现如下错误:
2014-12-18 17:37:23,630 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Before Scheduling: PendingReds:1 ScheduledMaps:2 ScheduledReds:0 AssignedMaps:0 AssignedReds:0 CompletedMaps:0 CompletedReds:0 ContAlloc:0 ContRel:0 HostLocal:0 RackLocal:0
2014-12-18 17:37:23,653 ERROR [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: ERROR IN CONTACTING RM.
java.io.IOException: org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException: Invalid resource request, requested memory < 0, or requested memory > max configured, requestedMemory=-1, maxMemory=8192
        at org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.validateResourceRequest(SchedulerUtils.java:198)
        at org.apache.hadoop.yarn.server.resourcemanager.RMServerUtils.validateResourceRequests(RMServerUtils.java:78)
        at org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService.allocate(ApplicationMasterService.java:394)
        at org.apache.hadoop.yarn.api.impl.pb.service.ApplicationMasterProtocolPBServiceImpl.allocate(ApplicationMasterProtocolPBServiceImpl.java:60)
        at org.apache.hadoop.yarn.proto.ApplicationMasterProtocol$ApplicationMasterProtocolService$2callBlockingMethod(ApplicationMasterProtocol.java:99)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2048)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2044)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
能帮我看看是为什么吗,这种错误我在网上没看到过,真不知道怎么解决,谢谢了

9 楼 wsy85 2014-08-13   引用

Java代码  

  1. log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
  2. log4j:WARN Please initialize the log4j system properly.
  3. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  4. Exception in thread "main" java.io.IOException: The ownership on the staging directory /tmp/hadoop-yarn/staging/simba/.staging is not as expected. It is owned by . The directory must be owned by the submitter simba or by simba
  5. at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:112)
  6. at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:344)
  7. at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1268)
  8. at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1265)
  9. at java.security.AccessController.doPrivileged(Native Method)
  10. at javax.security.auth.Subject.doAs(Unknown Source)
  11. at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
  12. at org.apache.hadoop.mapreduce.Job.submit(Job.java:1265)
  13. at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1286)
  14. at WordCount.main(WordCount.java:111)

在本地运行没问题,但加上你第三步说的那两行代码提交到集群上去执行就报如上异常。simba是我在hadoop集群的那台Linux的用户名,也是我win7的用户名。我重新设置了文件权限,甚至删除/tmp/目录里面的内容都无效。

8 楼 zy19982004 2014-06-27   引用

gao4263 写道

你的两个问题 
1.还是报错“exited with  exitCode: 1 due to: Exception from container-launch” 需要你自己去debug了 
2.ClassNotFoundException考虑插件是不是没有把jar包提交到hdfs上,也可以通过debug才看到。

7 楼 gao4263 2014-06-26   引用

楼主这个问题无解啊:
Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Map not found

我运行方式是 run on hadoop

6 楼 gao4263 2014-06-26   引用

gao4263 写道

 楼主 我下载了你的包还是报 
14/06/26 15:43:51 INFO mapreduce.Job: Job job_1403768617899_0002 failed with state FAILED due to: Application application_1403768617899_0002 failed 2 times due to AM Container for appattempt_1403768617899_0002_000002 exited with  exitCode: 1 due to: Exception from container-launch: 
org.apache.hadoop.util.Shell$ExitCodeException: 
at org.apache.hadoop.util.Shell.runCommand(Shell.java:464)
at org.apache.hadoop.util.Shell.run(Shell.java:379)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

1) Add such config property to your mapred-site.xml (client side only):  
<property>  
<name>mapreduce.application.classpath</name>  
<value>  
$HADOOP_CONF_DIR,  
$HADOOP_COMMON_HOME/share/hadoop/common/*,  
$HADOOP_COMMON_HOME/share/hadoop/common/lib/*,  
$HADOOP_HDFS_HOME/share/hadoop/hdfs/*,  
$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*,  
$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*,  
$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*,  
$HADOOP_YARN_HOME/share/hadoop/yarn/*,  
$HADOOP_YARN_HOME/share/hadoop/yarn/lib/*  
</value>  
</property>   这个一定要写才可以啊,

5 楼 gao4263 2014-06-26   引用

 楼主 我下载了你的包还是报 
14/06/26 15:43:51 INFO mapreduce.Job: Job job_1403768617899_0002 failed with state FAILED due to: Application application_1403768617899_0002 failed 2 times due to AM Container for appattempt_1403768617899_0002_000002 exited with  exitCode: 1 due to: Exception from container-launch: 
org.apache.hadoop.util.Shell$ExitCodeException: 
at org.apache.hadoop.util.Shell.runCommand(Shell.java:464)
at org.apache.hadoop.util.Shell.run(Shell.java:379)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

4 楼 yuezhichao 2014-06-20   引用

右键 run on hadoop

3 楼 zy19982004 2014-06-03   引用

yuezhichao 写道

上面的错误我要怎么修改呀!

WordCount程序怎么运行的?

2 楼 yuezhichao 2014-06-01   引用

上面的错误我要怎么修改呀!

1 楼 yuezhichao 2014-06-01   引用

log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1752)
at org.apache.hadoop.mapred.JobConf.getCombinerClass(JobConf.java:1139)
at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1517)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1010)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:390)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1720)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1744)
... 11 more
Caused by: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1718)
... 12 more

Error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1752)
at org.apache.hadoop.mapred.JobConf.getCombinerClass(JobConf.java:1139)
at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1517)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1010)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:390)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1720)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1744)
... 11 more
Caused by: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1718)
... 12 more

Error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1752)
at org.apache.hadoop.mapred.JobConf.getCombinerClass(JobConf.java:1139)
at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1517)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1010)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:390)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1720)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1744)
... 11 more
Caused by: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1718)
... 12 more

Error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1752)
at org.apache.hadoop.mapred.JobConf.getCombinerClass(JobConf.java:1139)
at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1517)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1010)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:390)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1720)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1744)
... 11 more
Caused by: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1718)
... 12 more

Error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1752)
at org.apache.hadoop.mapred.JobConf.getCombinerClass(JobConf.java:1139)
at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1517)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1010)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:390)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1720)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1744)
... 11 more
Caused by: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1718)
... 12 more

Error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1752)
at org.apache.hadoop.mapred.JobConf.getCombinerClass(JobConf.java:1139)
at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1517)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:1010)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:390)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1720)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1744)
... 11 more
Caused by: java.lang.ClassNotFoundException: Class test.WordCount$Reduce not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1718)
... 12 more

Exception in thread "main" java.io.IOException: Job failed!
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:836)
at test.WordCount.main(WordCount.java:72)

时间: 2024-10-23 22:25:44

Win7下无法提交MapReduce Job到集群环境(转)的相关文章

Hadoop学习三十二:Win7下无法提交MapReduce Job到集群环境

一. 对hadoop eclipse plugin认识不足 http://zy19982004.iteye.com/blog/2024467曾经说到我最hadoop eclipse plugin作用的认识.但事实上我犯了一个错误,Win7 Eclipse里的MyWordCount程序一直在本地运行,没有提交到集群环境上运行(查看192.168.1.200:50030)没有这个Job.运行方式分为两种,右键Run As Java Application Run on Hadoop 如果说Run A

rocketmq那些事儿之集群环境搭建

上一篇入门基础部分对rocketmq进行了一个基础知识的讲解说明,在正式使用前我们需要进行环境的搭建,今天就来说一说rockeketmq分布式集群环境的搭建 前言 之前已经介绍了rocketmq的入门基础,相信各位已经基本了解,今天进行一个分布式集群的搭建,其实可以通过本地源码来进行源码的使用和学习,但是作为开发维护人员还是需要去了解分布式集群的部署流程,方便后面集群的调试和测试 配置参数 注意官方给的配置文件都是默认的,最简单的版本,线上的环境需要根据自己需求来进行配置,在这里说明下其中的部分

基于HBase Hadoop 分布式集群环境下的MapReduce程序开发

HBase分布式集群环境搭建成功后,连续4.5天实验客户端Map/Reduce程序开发,这方面的代码网上多得是,写个测试代码非常容易,可是真正运行起来可说是历经挫折.下面就是我最终调通并让程序在集群上运行起来的一些经验教训. 一.首先说一下我的环境: 1,集群的环境配置请见这篇博文. 2,开发客户机环境:操作系统是CentOS6.5,JDK版本是1.7.0-60,开发工具是Eclipse(原始安装是从google的ADT网站下载的ADT专用开发环境,后来加装了Java企业开发的工具,启动Flas

本地idea开发mapreduce程序提交到远程hadoop集群执行

https://www.codetd.com/article/664330 https://blog.csdn.net/dream_an/article/details/84342770 通过idea开发mapreduce程序并直接run,提交到远程hadoop集群执行mapreduce. 简要流程:本地开发mapreduce程序–>设置yarn 模式 --> 直接本地run–>远程集群执行mapreduce程序: 完整的流程:本地开发mapreduce程序--> 设置yarn模式

王家林的云计算分布式大数据Hadoop征服之旅:HDFS&amp;MapReduce&amp;HBase&amp;Hive&amp;集群管理

一:课程简介: 作为云计算实现规范和实施标准的Hadoop恰逢其时的应运而生,使用Hadoop用户可以在不了解分布式底层细节的情况下开发出分布式程序,从而可以使用众多廉价的计算设备的集群的威力来高速的运算和存储,而且Hadoop的运算和存储是可靠的.高效,的.可伸缩的,能够使用普通的社区服务器出来PB级别的数据,是分布式大数据处理的存储的理想选择. 本课程会助你深入浅出的掌握Hadoop开发(包括HDFS.MapReduce.HBase.Hive等),并且在此基础上掌握Hadoop集群的配置.维

elasticsearch与mongodb分布式集群环境下数据同步

1.ElasticSearch是什么 ElasticSearch 是一个基于Lucene构建的开源.分布式,RESTful搜索引擎.它的服务是为具有数据库和Web前端的应用程序提供附加的组件(即可搜索的存储库).ElasticSearch为应用程序提供搜索算法和相关的基础架构,用户只需要将应用程序中的数据上载到ElasticSearch数据存储中,就可以通过RESTful URL与其交互.ElasticSearch的架构明显不同于它之前的其他搜索引擎架构,因为它是通过水平伸缩的方式来构建的.不同

Ubuntu14(64位) 集群环境下安装Hadoop2.4

经过前边的积累,今天终于实现了集群环境下部署Hadoop,并成功运行了官方的例子. 工作如下: 两台机器: NameNode:上网小本,3G内存,机器名:YP-X100e,IP:192.168.101.130. DataNode:虚拟机,Win7下载VMWare10中虚拟Ubuntu14,虚拟机器名:ph-v370,IP:192.168.101.110 确保可互相ping通,按照机器名和IP配置各自机器的/etc/hosts文件和/etc/hostname文件,我的hosts配置内容如下 127

分布式集群环境下,如何实现session共享二(项目开发)

在上一篇分布式集群环境下,如何实现session共享一(应用场景)中,介绍了在分布式集群下,需要实现session共享的应用场景.并且最后留下了一个问题:在集群环境下,如何实现session的共享呢?.要解决这个问题,放在一篇中内容量有点大,还是一步一步来吧.本篇先搭建一个基础的web应用,完全基于原生态的servlet实现.思路是这样的: 1.准备一个页面index.jsp,页面中可以提交key/value对的请求参数数据数据 2.编写一个servlet,接收页面提交的请求,获取请求参数,并且

Linux下安装搭建Memcached集群环境

Linux下安装搭建Memcached集群环境