Could not find or load main clas

2021-05-01  本文已影响0人  香蕉弦定李
Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

Please check whether your etc/hadoop/mapred-site.xml contains the below configuration:

<property>

<name>yarn.app.mapreduce.am.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

<property>

<name>mapreduce.map.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

<property>

<name>mapreduce.reduce.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

看到解决方案是在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>

然后 看到

  1. 在命令行执行 hadoop classpath 获取
  2. 编辑yarn-site.xml,添加信息:
<configuration>
  <property>
    <name>yarn.application.classpath</name>
    <value>复制的Hadoop classpath信息</value>
  </property>
</configuration>

如图:


a4277a2fc8c5b65aff71c1afb1f2ca51.png

问题解决。

上一篇下一篇

猜你喜欢

热点阅读