hadoop大数据执行数据分析时报错错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster的解决办法
1、报错信息
2020-06-19 21:51:37.008]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster
[2020-06-19 21:51:37.008]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster
原因分析:
这是由于hadoop3.0的框架文件yarn-site.xml需要配置value,value配置错误导致
解决办法:查看变量
[hadoop@namenode ~]$ hadoop classpath
/hadoop/hadoop-3.0.0/etc/hadoop:/hadoop/hadoop-3.0.0/share/hadoop/common/lib/*:/hadoop/hadoop-3.0.0/share/hadoop/common/*:/hadoop/hadoop-3.0.0/share/hadoop/hdfs:/hadoop/hadoop-3.0.0/share/hadoop/hdfs/lib/*:/hadoop/hadoop-3.0.0/share/hadoop/hdfs/*:/hadoop/hadoop-3.0.0/share/hadoop/mapreduce/*:/hadoop/hadoop-3.0.0/share/hadoop/yarn:/hadoop/hadoop-3.0.0/share/hadoop/yarn/lib/*:/hadoop/hadoop-3.0.0/share/hadoop/yarn/*
添加到yarn-site.xml的value里面中
<configuration>
<!-- Site specific YARN configuration properties -->
<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>
<property>
<name>yarn.resourcemanager.address</name>
<value>namenode:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>namenode:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>namenode:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>namenode:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>namenode:8088</value>
</property>
<property>
<name>yarn.application.classpath</name>
<value>/hadoop/hadoop-3.0.0/etc/hadoop:/hadoop/hadoop-3.0.0/share/hadoop/common/lib/*:/hadoop/hadoop-3.0.0/share/hadoop/common/*:/hadoop/hadoop-3.0.0/share/hadoop/hdfs:/hadoop/hadoop-3.0.0/share/hadoop/hdfs/lib/*:/hadoop/hadoop-3.0.0/share/hadoop/hdfs/*:/hadoop/hadoop-3.0.0/share/hadoop/mapreduce/*:/hadoop/hadoop-3.0.0/share/hadoop/yarn:/hadoop/hadoop-3.0.0/share/hadoop/yarn/lib/*:/hadoop/hadoop-3.0.0/share/hadoop/yarn/*</value>
</property>
</configuration>
修改完成之后重启集群即可。
主题授权提示:请在后台主题设置-主题授权-激活主题的正版授权,授权购买:RiTheme官网
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。