“错误:找不到或加载主类";启动Hadoop时 [英] "Error: Could not find or load main class" when starting Hadoop
问题描述
我正在尝试在Windows 7机器上运行Hadoop(2.2.0)(是的,我知道在Linux上运行它会更好,但目前不可行). 我按照发布在 http://ebiquity上的说明进行操作.umbc.edu/Tutorials/Hadoop/14%20-%20start%20up%20the%20cluster.html 和
I'm trying to run Hadoop (2.2.0) on my Windows 7 machine (yes, I know that it would be better to run it on Linux, but it is not an option at this moment). I followed instructions posted at http://ebiquity.umbc.edu/Tutorials/Hadoop/14%20-%20start%20up%20the%20cluster.html and http://blog.sqltrainer.com/2012/01/installing-and-configuring-apache.html
在我尝试启动Hadoop之前,一切正常.我尝试运行的每个操作都以:Error: Could not find or load main class ...
错误结束.
例如正在运行
Evetyhing went fine until I tried to start Hadoop. Every operation I try to run finishes with : Error: Could not find or load main class ...
error.
For e.g. running
./hadoop version
以
Error: Could not find or load main class org.apache.hadoop.util.VersionInfo
它肯定看起来像是classpath的问题.但是,我不知道如何解决.我尝试设置其他环境变量,例如$ HADOOP_COMMON_HOME或$ HADOOP_HOME,但是没有运气.
It definitely looks like a problem with classpath. However, I have no idea how to solve it. I tried to set different environment variables, like $HADOOP_COMMON_HOME or $HADOOP_HOME but without luck.
有什么想法吗?
推荐答案
我的问题是资源管理器(纱线)无法加载Hadoop库(罐子). 我通过更新配置解决了这个问题. 将此添加到yarn-site.xml:
My problem was the Resource Manager(yarn) was not able to load Hadoop Libraries(jars). I solved this by updating the configurations. Added this to yarn-site.xml :
<property>
<name>yarn.application.classpath</name>
<value>C:/hadoop-2.8.0/share/hadoop/mapreduce/*,C:/hadoop-2.8.0/share/hadoop/mapreduce/lib/*,C:/Hadoop-2.8.0/share/hadoop/common/*,C:/Hadoop-2.8.0/share/hadoop/common/lib/*,
C:/hadoop-2.8.0/share/hadoop/hdfs/*,C:/hadoop-2.8.0/share/hadoop/hdfs/lib/*,C:/hadoop-2.8.0/share/hadoop/yarn/*,C:/hadoop-2.8.0/share/hadoop/yarn/lib/*</value>
</property>
请注意,根据您的系统,此处使用的路径可以是相对的.
Please note that the paths used here can be relative according to your system.
这篇关于“错误:找不到或加载主类";启动Hadoop时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!