hadoop运行jar包出现错误代码为127的解决方案_Exit code: 127

今天在运行程序的时候新发现的一个错误(Exit code: 127),下面提供解决方案,希望能帮助大家。下面是错误的信息:

Job job_1601252515583_0001 failed with state FAILED due to: Application application_1601252515583_0001 failed 2 times due to AM Container for appattempt_1601252515583_0001_000002 exited with  exitCode: 127
Failing this attempt.Diagnostics: [2020-09-28 08:26:44.435]Exception from container-launch.
Container id: container_1601252515583_0001_02_000001
Exit code: 127

[2020-09-28 08:26:44.440]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

出现这个错误的原因就是,没有在etc/hadoop/yarn-env.sh中配置java的环境变量的路径。

编辑yarn-env.sh文件,在文件内添加如下JAVA_HOME为信息即可。

export $JAVA_HOME=/usr/local/javajdk

猜你喜欢

转载自blog.csdn.net/cczxcce/article/details/108842163