hadoop 找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster

这个是 因为 在 yarn 执行MapReduce的使用 找不到 hadoop 的classpath

一般在 shell中输入

hadoop  classpath

输出为

/etc/hadoop/conf:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop/lib/*:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop/.//*:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop-hdfs/./:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop-hdfs/lib/*:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop-hdfs/.//*:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop-yarn/lib/*:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/lib/hadoop/libexec/../../hadoop-yarn/.//*:/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/lib/*:/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/.//*

然后 这些输出 直接 粘贴到 yarn 的配置文件里 yarn-site.xml
的 属性 yarn.application.classpath
赋值
对于 使用cdh 安装的 hadoop
直接修改 /etc/hadoop/conf/yarn-site.xml 然后重启yarn

yarn  nodemanager &
yarn  resourcemanager &

还有这个错误

Container launch failed for container_1531560184035_0010_01_000003 : org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException: The auxService:mapreduce_shuffle does not exist

也是修改 yarn-site.xml 后重启

 
           yarn.nodemanager.aux-services
            mapreduce_shuffle
   
 
    yarn.nodemanager.aux-services.mapreduce_shuffle.class
    org.apache.hadoop.mapred.ShuffleHandler
  

检验 MapReduce 是否可用
hadoop jar ./hadoop-mapreduce-examples-2.8.2.jar wordcount /derby.log /outputs

你可能感兴趣的:(hadoop 找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster)