Mac在Hadoop的yarn上运行mapreduce报错ExitCodeException exitCode=127:

hadoop 2.7.2

17/04/14 14:07:00 INFO mapreduce.Job: Job job_1492146520853_0005 running in uber mode : false
17/04/14 14:07:00 INFO mapreduce.Job:  map 0% reduce 0%
17/04/14 14:07:00 INFO mapreduce.Job: Job job_1492146520853_0005 failed with state FAILED due to: Application application_1492146520853_0005 failed 2 times due to AM Container for appattempt_1492146520853_0005_000002 exited with  exitCode: 127
For more detailed output, check application tracking page:http://MacBook-Pro.local:8088/cluster/app/application_1492146520853_0005Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1492146520853_0005_02_000001
Exit code: 127
Stack trace: ExitCodeException exitCode=127: 
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:545)
    at org.apache.hadoop.util.Shell.run(Shell.java:456)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:212)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)


Container exited with a non-zero exit code 127

先去http://localhost:8088/cluster上查看失败日志

发现找不到/bin/java

修改yarn-env.sh

24 if [ "$JAVA_HOME" != "" ]; then
 25   #echo "run java in $JAVA_HOME"
 26   JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
 27 fi
 28 
 29 if [ "$JAVA_HOME" = "" ]; then
 30   echo "Error: JAVA_HOME is not set."
 31   exit 1
 32 fi
 33 
 34 JAVA=$JAVA_HOME/bin/java

改第26行 JAVA_HOME就可以了 原来默认是$JAVA_HOME
第34行没有读到

参考文章:http://blog.csdn.net/lihe2008125/article/details/44901791

他让我去/bin/下面创建一个java 软连接,我没权限,所以只能另辟蹊径了。

    原文作者:Albert陈凯
    原文地址: https://www.jianshu.com/p/364f247446c1
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞