Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

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:



yarn.app.mapreduce.am.env

HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}





mapreduce.map.env

HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}





mapreduce.reduce.env

HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}


看到解决方案是在mapred-site.xml配置中加入配置信息之后,分发到各个节点,再重启。操作后无效。

 
      yarn.app.mapreduce.am.env
      HADOOP_MAPRED_HOME=${HADOOP_HOME}
    
    
      mapreduce.map.env
      HADOOP_MAPRED_HOME=${HADOOP_HOME}
    
    
      mapreduce.reduce.env
      HADOOP_MAPRED_HOME=${HADOOP_HOME}
    

然后 看到

  1. 在命令行执行 hadoop classpath 获取
  2. 编辑yarn-site.xml,添加信息:

  
    yarn.application.classpath
    复制的Hadoop classpath信息
  

如图:


a4277a2fc8c5b65aff71c1afb1f2ca51.png

问题解决。

你可能感兴趣的:(Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster)