gpt4 book ai didi

java - 无法找到或加载主类 org.apache.hadoop.mapred.YarnChild Hadoop3.0.0

转载 作者:行者123 更新时间:2023-12-04 17:45:34 29 4
gpt4 key购买 nike

我正在尝试将 hadoop-mapreduce-examples-3.0.0.jar 运行到 hadoop 集群 (hadoop3.0.0),但我看到错误为无法找到或加载主类 org.apache.hadoop.mapred.YarnChild。

命令:hadoop jar hadoop-mapreduce-examples-3.0.0.jar pi 2 10

下图是我的错误详细信息

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>

我没有设置HADOOP_CLASSPATH,不知道是不是有问题

最佳答案

您应该将属性添加到 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>

关于java - 无法找到或加载主类 org.apache.hadoop.mapred.YarnChild Hadoop3.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48639030/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com