我在MacOS开发环境中使用Apache Hadoop 2.2.0。当尝试运行apache文档中描述的hadoop微型集群时:
hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar minicluster
我收到错误
java.lang.NoClassDefFoundError:org/apache/hadop/yarn/server/MiniYARNCluster网址:org.apache.hadop.mapreduce.MiniHadooPlusterManager.start(MiniHadopClusterManager.java:170)网址:org.apache.hadop.mapreduce.MiniHadooPlusterManager.run(MiniHadopClusterManager.java:129)在。..
有什么办法解决这个问题吗?
看起来我找到了解决方案:默认情况下,包含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
我知道这是一篇旧帖子,但我最近需要解决这个问题,无法找到MR2和YARN测试的完整解决方案,所以我想分享我发现的内容
http://www.lopakalogic.com/articles/hadoop-articles/hadoop-testing-with-minicluster/
希望它能帮助