gpt4 book ai didi

hadoop hdfs namenode 格式不起作用

转载 作者:可可西里 更新时间:2023-11-01 16:37:57 25 4
gpt4 key购买 nike

我是hadoop新手,我尝试在我的vm中安装hadoop3.0,在我配置hadoop之后,然后尝试:

hdfs namenode ‐format

得到输出:

2017-12-26 00:20:56,255 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = localhost/127.0.0.1
STARTUP_MSG: args = [‐format]
STARTUP_MSG: version = 3.0.0
STARTUP_MSG: classpath = /opt/hadoop-3.0.0/etc/hadoop:/opt/hadoop-3.0.0/share/hadoop/common/lib/xz-1.0.jar:/opt/hadoop-3.0.0/share/hadoop/common/lib/kerby-util-1.0.1.jar: ............. hadoop-yarn-applications-unmanaged-am-launcher-3.0.0.jar:/opt/hadoop-3.0.0/share/hadoop/yarn/hadoop-yarn-registry-3.0.0.jar
STARTUP_MSG: build = https://git-wip-us.apache.org/repos/asf/hadoop.git -r c25427ceca461ee979d30edd7a4b0f50718e6533; compiled by 'andrew' on 2017-12-08T19:16Z
STARTUP_MSG: java = 1.8.0_151
************************************************************/
2017-12-26 00:20:56,265 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
2017-12-26 00:20:56,269 INFO namenode.NameNode: createNameNode [‐format]
Usage: hdfs namenode [-backup] |
[-checkpoint] |
[-format [-clusterid cid ] [-force] [-nonInteractive] ] |
[-upgrade [-clusterid cid] [-renameReserved<k-v pairs>] ] |
[-upgradeOnly [-clusterid cid] [-renameReserved<k-v pairs>] ] |
[-rollback] |
[-rollingUpgrade <rollback|started> ] |
[-importCheckpoint] |
[-initializeSharedEdits] |
[-bootstrapStandby [-force] [-nonInteractive] [-skipSharedEditsCheck] ] |
[-recover [ -force] ] |
[-metadataVersion ]

2017-12-26 00:20:56,365 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
************************************************************/

我配置 hdfs-site.xml 如下:

<configuration>

<property>
<name>dfs.replication</name>
<value>1</value>
</property>

<property>
<name>dfs.namenode.name.dir</name>
<value>/home/dan/hadoop_data/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/home/dan/hadoop_data/datanode</value>
</property>

</configuration>

当我启动 namenode 服务时,它失败并记录告诉:2017-12-26 00:03:41,331 信息 org.apache.hadoop.util.ExitUtil:以状态 1 退出:java.io.IOException:NameNode 未格式化。2017-12-26 00:03:41,337 信息 org.apache.hadoop.hdfs.server.namenode.NameNode:SHUTDOWN_MSG:

谁能告诉我解决这个问题?

提前致谢!

最佳答案

解决方案一:

有时它会发生。首先,停止所有服务并转到您的 current 目录并删除 current 目录。 Hadoop current 目录也存储所有日志文件。通过删除 current 目录重新启动所有服务。

停止所有服务:

$HADOOP_HOME/sbin/stop-all.sh

停止所有服务后,您应该通过以下命令格式化Namenode。

格式名称节点:

$HADOOP_HOME/bin/hadoop namenode –format

现在再次通过以下命令启动所有服务。

启动所有服务:

$HADOOP_HOME/sbin/start-all.sh

解决方案 2:

有时 Namenode 会进入安全模式。您需要通过以下命令离开安全节点。

$HADOOP_HOME/bin/hdfs dfsadmin -safemode leave

关于hadoop hdfs namenode 格式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47975964/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com