在centos7格式化后无法启动namenode

时间:2017-01-03 10:52:53

标签: hadoop centos7

运行format命令后,我无法在hdp 2.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

2 个答案:

答案 0 :(得分:0)

错误

  

错误:找不到配置目录:

抛出

是因为命令中使用的变量$ HADOOP_CONF_DIR未在环境中设置,并且尝试启动没有实际配置<asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="chkRowPaid" runat="server" Enabled='<%# Eval("Amount_Paid_By_Driver").ToString() != "1" %>' CssClass="paid" /> </ItemTemplate> <HeaderTemplate> <asp:CheckBox ID="SelectAllPaid" runat="server" onclick="CheckAllPaid(this);" /> </HeaderTemplate> <HeaderStyle HorizontalAlign="left" /> <ItemStyle HorizontalAlign="left" /> </asp:TemplateField> </Columns> </asp:GridView> <script type="text/javascript"> function CheckAllPaid(objRef) { var GridView = objRef.parentNode.parentNode.parentNode; var spanList = GridView.getElementsByClassName("paid"); for (var i = 0; i < spanList.length; i++) { var input = spanList[i].childNodes[0]; if (objRef.checked && !input.disabled) { input.checked = true; } else { input.checked = false; } } } </script> 路径的namenode。

修复环境变量赋值后,.bashrc应该如下所示(假设安装是通过tarball)

--config $HADOOP_CONF_DIR

答案 1 :(得分:0)

使用以下参数更新您的.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

中反映。