错误:无法在Hadoop上找到或加载主类org.apache.hadoop.hdfs.tools.GetConf

时间:2015-02-12 05:17:51

标签: java apache hadoop

Error: Could not find or load main class org.apache.hadoop.hdfs.tools.GetConf

在[]上启动名称节点 localhost:起始namenode,登录到/usr/local/hadoop/hadoop-2.6.0/logs/hadoop-ingreens-namenode-ingreens-desktop.out localhost:启动datanode,登录到/usr/local/hadoop/hadoop-2.6.0/logs/hadoop-ingreens-datanode-ingreens-desktop.out 错误:无法找到或加载主类org.apache.hadoop.hdfs.tools.GetConf

和jps show

13033 Jps 12873 DataNode

使用Hadoop 2.6.0

我应该做什么。

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题!我解决了改变.bashrc文件的问题。将这些行添加到$ HOME / .bashrc文件的末尾,更改hadoop安装路径:

<code>
#Set hadoop-related enviroment variables
export HADOOP_PREFIX=/usr/local/hadoop-2.7.1
export HADOOP_HOME=/usr/local/hadoop-2.7.1
export HADOOP_MAPRED_HOME=${HADOOP_HOME}
export HADOOP_COMMON_HOME=${HADOOP_HOME}
export HADOOP_HDFS_HOME=${HADOOP_HOME}
export YARN_HOME=${HADOOP_HOME}
export HADOOP_CONFDIR=${HADOOP_HOME}/etc/hadoop
# Native path
export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}/lib/native
export HADOOP_OPTS="-Djava.library.path=${HADOOP_PREFIX}/lib/native"
export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native:$JAVA_LIBRARY_PATH
# Add Hadoop bin/ directory to PATH
export PATH=$PATH:$HADOOP_HOME/
export PATH=$PATH:$HADOOP_HOME/bin
</code>

我希望这有助于某人