问题描述:
找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster
原因:yarn-site.xml与mapred-site.xml文件中未配置yarn.application.classpath
解决方案:
1.先在hadoop3.2.2目录下运行hadoop classpath找到内容复制
2.在etc/hadoop目录下yarn-site.xml与mapred-site.xml文件中添加以下配置
<property>
<name>yarn.application.classpath</name>
<value>/opt/module/hadoop-3.2.2/etc/hadoop:/opt/module/hadoop-3.2.2/share/hadoop/common/lib/*:/opt/module/hadoop-3.2.2/share/hadoop/common/*:/opt/module/hadoop-3.2.2/share/hadoop/hdfs:/opt/module/hadoop-3.2.2/share/hadoop/hdfs/lib/*:/opt/module/hadoop-3.2.2/share/hadoop/hdfs/*:/opt/module/hadoop-3.2.2/share/hadoop/mapreduce/lib/*:/opt/module/hadoop-3.2.2/share/hadoop/mapreduce/*:/opt/module/hadoop-3.2.2/share/hadoop/yarn:/opt/module/hadoop-3.2.2/share/hadoop/yarn/lib/*:/opt/module/hadoop-3.2.2/share/hadoop/yarn/*</value>
</property>
value部分是hadoop classpath的内容
参考博客:
https://www.cnblogs.com/wanchen-chen/p/12934098.html
https://www.jianshu.com/p/229a30a51c36