Java 从windows eclipse运行Mapreduce(纱线)时出错

Java 从windows eclipse运行Mapreduce(纱线)时出错,java,eclipse,hadoop,mapreduce,yarn,Java,Eclipse,Hadoop,Mapreduce,Yarn,我正在从eclipse运行一个WordCount程序。 我尝试使用Hadoop1.x,它运行良好。 在hadoop2.x上运行时面临问题 我试过了 1) 将所有xml添加到我的类路径中。 2) 还尝试了conf.set(),在conf对象中设置xml属性 日志中还显示:-没有可用于集装箱的日志\u 1394042163908\u 0573\u 01\u000001 应用程序\u 1394042163908\u 0573失败2次,原因是appattempt的AM容器\u 1394042163908

我正在从eclipse运行一个WordCount程序。 我尝试使用Hadoop1.x,它运行良好。 在hadoop2.x上运行时面临问题

我试过了 1) 将所有xml添加到我的类路径中。 2) 还尝试了conf.set(),在conf对象中设置xml属性

日志中还显示:-没有可用于集装箱的日志\u 1394042163908\u 0573\u 01\u000001

应用程序\u 1394042163908\u 0573失败2次,原因是appattempt的AM容器\u 1394042163908\u 0573\u000002退出,退出代码为:1,原因是:容器启动异常:
org.apache.hadoop.util.Shell$ExitCodeException:/bin/bash:line 0:fg:无作业控制
位于org.apache.hadoop.util.Shell.runCommand(Shell.java:464)
位于org.apache.hadoop.util.Shell.run(Shell.java:379)
位于org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
位于org.apache.hadoop.warn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerEx ecutor.java:195)
位于org.apache.hadoop.warn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
位于org.apache.hadoop.warn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:79)
位于java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
在java.util.concurrent.FutureTask.run(FutureTask.java:166)中
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)`此处输入代码`
位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
运行(Thread.java:722)
.这次尝试失败了。。应用程序失败。

我已经解决了这个问题,这里有一个jira:

我刚刚将YARNRunner.java和MRApps.java添加到我的项目中。 它还要求将以下属性添加到windows框上的mapred-site.xml,以便作业启动程序知道作业运行程序将是linux:

<property>
<name>mapred.remote.os</name>
<value>Linux</value>
<description>Remote MapReduce framework's OS, can be either Linux or Windows</description>
</property>

mapred.remote.os
Linux
远程MapReduce框架的操作系统可以是Linux或Windows
MapReduce现在运行良好

还要将org.apache.hadoop.util.Shell.java复制到项目中

您可以注释掉下面的行,以删除winutils.exe错误。
抛出新的IOException(“在Hadoop二进制文件中找不到可执行文件”+fullExeName+”)