再次运行hadoop碰到的坑——重启时需要格式化

每次想要重新启动hadoop的时候:
1、需要先关闭hadoop

stop-all.sh

2、清除hadoop/tmp下的文件(非必须步骤,该路径为core-site.xml文件中Hadoop.tmp.dir路径)
3、随后格式化namenode

hadoop namenode -format

4、最后再启动hdfs和yarn

cd hadoop/sbin
start-dfs.sh
start-yarn.sh

少一步都有可能导致启动失败。

参考文章:https://mp.weixin.qq.com/s?__biz=MzI1MzY0MzE4Mg==&mid=2247484719&idx=1&sn=51dde3c8cc95b4b8f8a7af8bf7b5863e&chksm=e9d015eedea79cf822310fffe5f86bf63fd9731624155a2bfcfb1abd130788162a4dbbdd93a7&mpshare=1&scene=1&srcid=&key=04b8de3bb21a153bd48f1c5c7f328ddbf69a81cf74641299baa1660dcfee573f1f6e7898111c5a27e9c01a3b27cf3ec680d9c4ed8c943aa5fb2d7318a4827047cc47f9147dc7b267f783bca235a925c2&ascene=1&uin=MjM4NDU1MTcyMQ%3D%3D&devicetype=Windows+10&version=62060833&lang=zh_CN&pass_ticket=SFQJUrtH1CL16C8uOQTM2%2FvrsZU9uN7hT4aywQ9J9vQUO7g2YEgINs%2F6o%2FJd9f5n

你可能感兴趣的:(再次运行hadoop碰到的坑——重启时需要格式化)