hadoop伪分布式wordcount报错Container exited with a non-zero exit code 1. Error file: prelaunch.err

按照教程搭建了伪分布式hadoop
hadoop伪分布部署

环境

Ubuntu 16.04
openJDK7

运行wordcount时报错如下

[2018-10-18 19:40:27.332]Exception from container-launch.
Container id: container_1539853922352_0003_01_000002
Exit code: 1

[2018-10-18 19:40:27.340]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :


[2018-10-18 19:40:27.356]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :

有的人好像也会报底下的错,但是解决方法是一样的。

错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaste

解决办法

mapred-site.xml文件中添加mapreduce所需要用到的classpath。


   mapreduce.application.classpath
   $HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*, $HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*

$HADOOP_MAPRED_HOME要写安装hadoop的绝对路径,我的是/opt/hadoop-2.9.1,所以最后就是


   mapreduce.application.classpath
   /opt/hadoop-2.9.1/share/hadoop/mapreduce/*, /opt/hadoop-2.9.1/share/hadoop/mapreduce/lib/*

错误解决参考:
mapreduce job failed. exited with exitCode 1 —> 说了原因没说具体解决办法
解决运行 Hadoop MapReduce 任务时错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster —> 完美解决问题

你可能感兴趣的:(bug,hadoop)