gpt4 book ai didi

hadoop - 错误启动 hadoop 2.2.0 minicluster : java. lang.NoClassDefFoundError: org/apache/hadoop/yarn/server/MiniYARNCluster

转载 作者:可可西里 更新时间:2023-11-01 16:22:13 26 4
gpt4 key购买 nike

我在 MacOS 开发环境中使用 Apache Hadoop 2.2.0。当尝试按照 apache 文档中的描述运行 hadoop minicluster 时:

hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar  minicluster

我遇到了错误

java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/server/MiniYARNCluster at org.apache.hadoop.mapreduce.MiniHadoopClusterManager.start(MiniHadoopClusterManager.java:170) at org.apache.hadoop.mapreduce.MiniHadoopClusterManager.run(MiniHadoopClusterManager.java:129) at . . . . . . .

有什么解决办法吗?

最佳答案

看起来我找到了解决方案:默认情况下,包含 MiniYARNCluster 的 jar 文件不是 Hadoop 类路径的一部分,它必须显式添加到 HADOOP_CLASSPATH 中。下面的代码片段运行良好:

export HADOOP_CLASSPATH=./share/hadoop/yarn/test/hadoop-yarn-server-tests-2.2.0-tests.jar
./bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar minicluster

关于hadoop - 错误启动 hadoop 2.2.0 minicluster : java. lang.NoClassDefFoundError: org/apache/hadoop/yarn/server/MiniYARNCluster,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20249726/

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