美文网首页
Could not find or load main clas

Could not find or load main clas

作者: 香蕉弦定李 | 来源:发表于2021-05-01 13:48 被阅读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

    问题解决。

    相关文章

      网友评论

          本文标题:Could not find or load main clas

          本文链接:https://www.haomeiwen.com/subject/osvyyhtx.html