简体   繁体   English

启动namenode而不进行格式化

[英]Start namenode without formatting

I tried to start namenode using bin/start-all.sh. 我尝试使用bin / start-all.sh启动namenode。 But, this command doesnt start namenode. 但是,这个命令不会启动namenode。 I know if I do bin/hadoop namenode -format , namenode will start but in that case, I will lose all my data. 我知道如果我做bin / hadoop namenode -format,namenode会启动,但在这种情况下,我将丢失所有数据。 Is there a way to start namenode without formatting it? 有没有办法在不格式化的情况下启动namenode?

Your problem might be related to the following: 您的问题可能与以下内容有关:

Hadoop writes its NameNode data in /tmp/hadoop- folder by default which is cleaned after every reboot. 默认情况下,Hadoop将其NameNode数据写入/ tmp / hadoop-文件夹,每次重启后都会将其清除。

Add following property to conf/hdfs-site.xml 将以下属性添加到conf / hdfs-site.xml

<property>
   <name>dfs.name.dir</name>
   <value><path to your desired folder></value>
</property>

The "dfs.name.dir" property allows you to control where Hadoop writes NameNode metadata. “dfs.name.dir”属性允许您控制Hadoop写入NameNode元数据的位置。

bin/start-all.sh should start the namenode, as well as the datanodes, the jobtracker and the tasktrackers. bin/start-all.sh应该启动namenode,以及datanode,jobtracker和tasktrackers。 So, check the log of the namenode for possible errors. 因此,请检查namenode的日志以查找可能的错误。

An alternative way to skip starting the jobtracker and the tasktrackers and just start the namenode (and the datanodes) is by using the command: bin/start-dfs.sh 跳过启动jobtracker和tasktrackers并启动namenode(和datanode)的另一种方法是使用以下命令: bin/start-dfs.sh

Actually, bin/start-all.sh is equivalent to using the commands: 实际上, bin/start-all.sh相当于使用命令:

bin/start-dfs.sh , which starts the namenode and datanodes and bin/start-dfs.sh ,它启动namenode和datanodes和
bin/start-mapred.sh , which starts the jobtracker and the tasktrackers. bin/start-mapred.sh ,它启动jobtracker和tasktrackers。

For more details, visit this page . 有关更多详细信息,请访问此页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM