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
的 属性 <name>yarn.application.classpath</name>
赋值
对于 使用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 后重启

 <property>
           <name>yarn.nodemanager.aux-services</name>
            <value>mapreduce_shuffle</value>
   </property>
 <property>
    <name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
    <value>org.apache.hadoop.mapred.ShuffleHandler</value>
  </property>

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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值