报错信息:
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 文章来源:https://www.toymoban.com/news/detail-770555.html
其中 /usr/local/jdk/jdk1.8.0_161/为你的jdk安装目录,也就是配置到环境变量中的JAVA_HOME的路径文章来源地址https://www.toymoban.com/news/detail-770555.html
到了这里,关于hadoop运行jar遇到的一个报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!