在centos7中格式化后无法启动namenode

rxztt3cl  于 2021-05-29  发布在  Hadoop
关注(0)|答案(2)|浏览(538)

在运行format命令后,我无法在HDP2.3.4 centos 7中启动namenode。我得到下面的错误:错误:找不到配置目录:下面的开始是bashrc文件:

if [ -f ~/.bashrc ]; then
    . ~/.bashrc
 fi

用户特定环境和启动程序

PATH=$PATH:$HOME/bin

export PATH
export JAVA_HOME=$PATH/jdk1.7.0_71
export HADOOP_INSTALL=$PATH/hadoop-2.3.4
export PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
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_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib"

下面是我正在执行的启动namenode的命令:

/usr/hdp/current/hadoop-hdfs-namenode/../hadoop/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR start namenode
bf1o4zei

bf1o4zei1#

更新您的 .bashrc 具有以下参数

export JAVA_HOME= location of the JAVA_home (/usr/java/jdk1.x.x)
export HADOOP_HOME=location of the HADOOP_HOME (User defined)
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export PATH

注意:hadoop的安装位置应该是 HADOOP_HOME ,它会反射进来 hadoop-env.sh

wnvonmuf

wnvonmuf2#

错误
错误:找不到配置目录:
引发的原因是命令中使用的变量$hadoop\u conf\u dir未在环境中设置,并且尝试在没有实际配置的情况下启动namenode --config $HADOOP_CONF_DIR 路径。
在修复了环境变量赋值之后,.bashrc应该是这样的(假设安装是通过tarballs)

export JAVA_HOME=/<absolute_path_where_jdk_is_extracted>/jdk1.7.0_71
export HADOOP_INSTALL=/<absolute_path_where_hdp_is_extracted>/hadoop-2.3.4
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_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib"
export HADOOP_CONF_DIR=$HADOOP_INSTALL/etc/hadoop
export PATH=$PATH:$HADOOP_INSTALL/bin:$HADOOP_INSTALL/sbin:$JAVA_HOME/bin

相关问题