Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find or load main class org.apache.hadoop.mapred.YarnChild Hadoop3.0.0

Tags:

java

hadoop

I am trying to run hadoop-mapreduce-examples-3.0.0.jar to a hadoop cluster (hadoop3.0.0),but I see the error as Could not find or load main class org.apache.hadoop.mapred.YarnChild.

command:hadoop jar hadoop-mapreduce-examples-3.0.0.jar pi 2 10

below image is my error details

Exception

<!-- core-site.xml --> 
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://master:9000</value>
</property>
<property>
    <name>hadoop.tmp.dir</name>
    <value>/tmp/hadoopdata</value>
</property>

<!-- hdfs-site.xml -->
<property>
    <name>dfs.replication</name>
    <value>3</value>
</property>

<!-- yarn-site.xml  -->
    <property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
</property>
<property>
    <name>yarn.resourcemanager.hostname</name>
    <value>master</value>
</property>

<!-- mapred-site.xml -->
<property>
    <name>mapreduce.framework.name</name>
    <value>yarn</value>
</property>
<property>
    <name>yarn.app.mapreduce.am.env</name>
    <value>HADOOP_MAPRED_HOME=$HADOOP_COMMON_HOME</value>
</property>

I do not set the HADOOP_CLASSPATH,and I don't know whether or not it's problem

like image 739
Yeauty Avatar asked Sep 17 '25 16:09

Yeauty


1 Answers

you should add property to yarn-site.xml

<property>
<name>yarn.application.classpath</name>

<value>
/opt/module/hadoop-3.1.3/etc/hadoop,
/opt/module/hadoop-3.1.3/share/hadoop/common/*,
/opt/module/hadoop-3.1.3/share/hadoop/common/lib/*,
/opt/module/hadoop-3.1.3/share/hadoop/hdfs/*,
/opt/module/hadoop-3.1.3/share/hadoop/hdfs/lib/*,
/opt/module/hadoop-3.1.3/share/hadoop/mapreduce/*,
/opt/module/hadoop-3.1.3/share/hadoop/mapreduce/lib/*,
/opt/module/hadoop-3.1.3/share/hadoop/yarn/*,
/opt/module/hadoop-3.1.3/share/hadoop/yarn/lib/*
</value>
</property>
like image 172
爱哭的翎狐 Avatar answered Sep 20 '25 08:09

爱哭的翎狐