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

问题

执行wordcount命令时,hadoop找不到或无法加载主类,org.apache.hadoop.mapreduce.v2.app.MRAppMaster
在这里插入图片描述
Hadoop:找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster_第1张图片

解决方案:

  1. 输入命令 hadoop classpath
    Hadoop:找不到或无法加载主类org.apache.hadoop.mapreduce.v2.app.MRAppMaster_第2张图片

2.将输出的内容直接复制到yarn-site.xml文件中:

<property>
    <name>yarn.application.classpathname>
    <value>/usr/local/hadoop3.1.2/etc/hadoop:/usr/local/hadoop3.1.2/share/hadoop/common/lib/*:/usr/local/hadoop3.1.2/share/hadoop/common/*:/usr/local/hadoop3.1.2/share/hadoop/hdfs:/usr/local/hadoop3.1.2/share/hadoop/hdfs/lib/*:/usr/local/hadoop3.1.2/share/hadoop/hdfs/*:/usr/local/hadoop3.1.2/share/hadoop/mapreduce/lib/*:/usr/local/hadoop3.1.2/share/hadoop/mapreduce/*:/usr/local/hadoop3.1.2/share/hadoop/yarn:/usr/local/hadoop3.1.2/share/hadoop/yarn/lib/*:/usr/local/hadoop3.1.2/share/hadoop/yarn/*value>
property>

你可能感兴趣的:(常见错误,#,Hadoop,Hadoop,找不到主类)