yarn报错ExitCodeException exitCode=127
想yarn上提交任务,报错:
18/12/14 17:48:56 INFO mapreduce.Job: Job job_1544766080243_0018 failed with state FAILED due to: Application a18_000002 exited with exitCode: 127 For more detailed output, check application tracking page:http://dev-hadoop6:8088/cluster/app/application_15447 Diagnostics: Exception from container-launch. Container id: container_1544766080243_0018_02_000001 Exit code: 127 Stack trace: ExitCodeException exitCode=127: at org.apache.hadoop.util.Shell.runCommand(Shell.java:585) at org.apache.hadoop.util.Shell.run(Shell.java:482) at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:776) at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerE at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLa at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLa at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Container exited with a non-zero exit code 127 Failing this attempt. Failing the application. 18/12/14 17:48:56 INFO mapreduce.Job: Counters: 0 18/12/14 17:48:56 WARN mapreduce.HdfsMapReduce: Path /mapred-temp/job-user-analysis-statistic/01/top_in is not java.io.IOException: Set input path failed ! at com.tracker.offline.common.mapreduce.HdfsMapReduce.setInputPath(HdfsMapReduce.java:165) at com.tracker.offline.common.mapreduce.HdfsMapReduce.buildJob(HdfsMapReduce.java:122) at com.tracker.offline.common.mapreduce.HdfsMapReduce.waitForCompletion(HdfsMapReduce.java:65) at com.tracker.offline.business.job.user.JobAnalysisStatisticMR.main(JobAnalysisStatisticMR.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
查看报错信息:yarn logs -applicationId application_1544766080243_0018
18/12/14 17:59:57 INFO client.RMProxy: Connecting to ResourceManager at dev-hadoop6/10.100.3.176:8032 Container: container_1544766080243_0018_01_000001 on dev-hadoop5_43772 ======================================================================== LogType:stderr Log Upload Time:星期五 十二月 14 17:48:56 +0800 2018 LogLength:50 Log Contents: /bin/bash: /bin/java: 没有那个文件或目录 End of LogType:stderr LogType:stdout Log Upload Time:星期五 十二月 14 17:48:56 +0800 2018 LogLength:0 Log Contents: End of LogType:stdout
这个是java找不到,修改yarn-env.sh
export JAVA_HOME=/home/jdk8
重新启动。
我们以第一句去网络上搜索相关答案,发现搜到的无外乎以下几种解决方案:
1,更改hadoop-env.sh中的java_home环境变量
2,更改yarn-site.xml中的yarn.application.classpath之类的classpath
3,添加mac中java软连接