当我尝试执行wordcount程序时出现了一个问题
术后结果:
2021-03-06 10:46:36,826 INFO mapreduce.Job: map 0% reduce 0%
2021-03-06 10:46:36,845 INFO mapreduce.Job: Job job_1614998747877_0001 failed with state FAILED due to: Application application_1614998747877_0001 failed 2 times due to AM Container for appattempt_1614998747877_0001_000002 exited with exitCode: 127
Failing this attempt.Diagnostics: [2021-03-06 10:46:36.605]Exception from container-launch.
Container id: container_1614998747877_0001_02_000001
Exit code: 127
[2021-03-06 10:46:36.645]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
[2021-03-06 10:46:36.646]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
For more detailed output, check the application tracking page: http://hadoop103:8088/cluster/app/application_1614998747877_0001 Then click on links to logs of each attempt.
. Failing the application.
接下来是网页中的信息:
Application application_1614998747877_0001 failed 2 times due to AM Container for appattempt_1614998747877_0001_000002 exited with exitCode: 127
Failing this attempt.Diagnostics: [2021-03-06 10:46:36.605]Exception from container-launch.
Container id: container_1614998747877_0001_02_000001
Exit code: 127
[2021-03-06 10:46:36.645]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
[2021-03-06 10:46:36.646]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
For more detailed output, check the application tracking page: http://hadoop103:8088/cluster/app/application_1614998747877_0001 Then click on links to logs of each attempt.
. Failing the application.
谢谢你的帮助
solved
需要添加JAVA_HOME路径到hadoop-env.sh
输入图片描述