hadoop:找不到或加载主类org.apache.hadoop.mapreduce.v2.app.mrappmaster

w41d8nur  于 2021-06-01  发布在  Hadoop
关注(0)|答案(1)|浏览(498)

在安装hadoop之后,我尝试启动一个相当简单的wordcount(我基本上遵循了本教程),但我得到了以下结果:

2018-04-05 16:51:00,192 INFO mapreduce.Job: Job job_1522936330711_0007 failed with state FAILED due to: Application application_1522936330711_0007 failed 2 times due to AM Container for appattempt_1522936330711_0007_000002 exited with  exitCode: 1
Failing this attempt.Diagnostics: [2018-04-05 16:50:59.449]Exception from container-launch.
Container id: container_1522936330711_0007_02_000001
Exit code: 1

[2018-04-05 16:50:59.452]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
Error : Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

[2018-04-05 16:50:59.452]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
Error : Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

For more detailed output, check the application tracking page: http://iMac-de-chaire-2.local:8088/cluster/app/application_1522936330711_0007 Then click on links to logs of each attempt.
. Failing the application.
2018-04-05 16:51:00,211 INFO mapreduce.Job: Counters: 0

当我尝试访问日志时,它会告诉我 "Failed to read the attempts of the application application_1522940117199_0001." 我有以下文件: hadoop-env.sh :

export HADOOP_HOME=/usr/local/hadoop/

export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native"
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
``` `yarn-site.xml` :
hmae6n7t

hmae6n7t1#

我也有同样的问题 macosx high-sierra . 若要解决此问题,请将这些属性添加到 mapred-site.xml :

<property>
 <name>yarn.app.mapreduce.am.env</name>
 <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
<property>
 <name>mapreduce.map.env</name>
 <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
<property>
 <name>mapreduce.reduce.env</name>
 <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>

相关问题