我正在从我的日食中运行一个WordCount程序。 我试过Hadoop1.x它运行正常。 在hadoop2.x上运行时面临问题
我试过了 1)将所有xml添加到我的类路径中。 2)也试过conf.set(),在conf对象中设置xml属性。同样在日志中它说:没有可用于容器容器的日志_1394042163908_0573_01_000001
Application application_1394042163908_0573 failed 2 times due to AM Container for appattempt_1394042163908_0573_000002 exited with exitCode: 1 due to: Exception from container-launch:
org.apache.hadoop.util.Shell$ExitCodeException: /bin/bash: line 0: fg: no job control
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(DefaultContainerEx ecutor.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$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)`enter code here`
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
.Failing this attempt.. Failing the application.
答案 0 :(得分:1)
我已经找到了问题,有一个jira:https://issues.apache.org/jira/browse/MAPREDUCE-5655
我刚刚添加了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>
现在MapReduce正常运行。
同时将org.apache.hadoop.util.Shell.java复制到您的项目中。
您可以注释掉以下行,以删除winutils.exe错误 抛出新的IOException(“无法在Hadoop二进制文件中找到可执行文件”+ fullExeName +“。);