hadoop运行jar遇到的一个报错

发布时间:2023年12月19日

报错信息:

2023-12-19 14:28:25,893 INFO mapreduce.Job: Job job_1702967272525_0001 failed with state FAILED due to: Application application_1702967272525_0001 failed 2 times due to AM Container for appattempt_1702967272525_0001_000002 exited with ?exitCode: 127
Failing this attempt.Diagnostics: [2023-12-19 14:28:25.741]Exception from container-launch.
Container id: container_1702967272525_0001_02_000001
Exit code: 127

[2023-12-19 14:28:25.784]Container exited with a non-zero exit code 127. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
/bin/bash: /bin/java: No such file or directory


[2023-12-19 14:28:25.785]Container exited with a non-zero exit code 127. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
/bin/bash: /bin/java: No such file or directory

问题分析:

从报错信息字面上看是找不到java执行目录,但是我在hadoop-env.sh? yarn-env.sh等配置文件中已经配置好了java的环境变量。接着想到既然说找不到/bin/java,那就直接把安装的jdk目录下的/bin/java执行文件直接链接到/bin/java

解决方案:

在hadoop集群的各节点都执行命令??ln -s ?/usr/local/jdk/jdk1.8.0_161/bin/java /bin/java? ?

其中?/usr/local/jdk/jdk1.8.0_161/为你的jdk安装目录,也就是配置到环境变量中的JAVA_HOME的路径

文章来源:https://blog.csdn.net/sunweiking/article/details/135084721
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。