hadoop3.1.3下MapReduce操作出现错误: 找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster 问题解决方法
Hadoop3.1.3下成功安装后,进行MapReduce操作出现错误:错误: 找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster解决办法:① 在命令行下输入如下命令,并将返回的地址复制。$ hadoop classpath/usr/local/hadoop/hadoop-3.1.3/etc/hadoop:/usr/local/hado
·
Hadoop3.1.3下成功安装后,进行MapReduce操作出现错误:
错误: 找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster
解决办法:
① 在命令行下输入如下命令,并将返回的地址复制。
$ hadoop classpath
/usr/local/hadoop/hadoop-3.1.3/etc/hadoop:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/common/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/common/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/hdfs:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/hdfs/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/hdfs/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/mapreduce/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/mapreduce/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/yarn:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/yarn/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/yarn/*
② 编辑yarn-site.xml
vim yarn-site.xml
#添加如下内容
<configuration>
<property>
<name>yarn.application.classpath</name>
<value>/usr/local/hadoop/hadoop-3.1.3/etc/hadoop:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/common/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/common/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/hdfs:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/hdfs/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/hdfs/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/mapreduce/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/mapreduce/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/yarn:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/yarn/lib/*:/usr/local/hadoop/hadoop-3.1.3//share/hadoop/yarn/*</value>
</property>
</configuration>
将yarn-site.xml分发到集群的其他节点,设置完毕后重启Hadoop集群,重新运行刚才的MapReduce程序,成功运行。
更多推荐
已为社区贡献2条内容
所有评论(0)