格式hadoop namenode给出错误cygwin

时间:2015-10-02 12:05:43

标签: windows hadoop cygwin

我正在尝试在cygwin上安装和配置我的电脑上的单节点hadoop集群。 Cygwin已经正确安装和配置,但hadoop配置给我带来了艰难的时间。

bin/hadoop namenode -format

让我无法找到或加载主要课程org.apache.hadoop.hdfs.server.namenode.NameNode

我已经解决了几个问题,但似乎都没有帮助我。

以下是我的bashrc文件的内容

export JAVA_HOME=/cygdrive/c/Progra~1/Java/jdk1.8.0_05
export HADOOP_INSTALL=/cygdrive/c/cygwin64/home/Chetan/hadoop-2.7.1
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
export HADOOP_CONF_DIR=$HADOOP_PREFIX/etc/hadoop
export PATH=$PATH:$HADOOP_INSTALL/sbin
export PATH=$PATH:$HADOOP_INSTALL/bin
export HADOOP_PREFIX=/cygdrive/c/cygwin64/home/Chetan/hadoop-2.7.1
export HADOOP_CLASSPATH=$(cygpath -pw $(hadoop classpath)):$HADOOP_CLASSPATH

我也在hadoop-env.sh中导出$JAVA_HOME,并且echo $JAVA_HOME工作正常。

1 个答案:

答案 0 :(得分:0)

export HADOOP_PREFIX=/path_to_hadoop_location

# for example:
# export HADOOP_PREFIX=/home/xxx/hadoop-x.x.xx

then source ~/.bashrc

参考:

Could not find or load main class when trying to format namenode; hadoop installation on MAC OS X 10.9.2