• Ubuntu中启动HDFS后没有NameNode解决办法


    关闭进程:

    stop-dfs.sh

    格式化

    hadoop namenode -format

    出现报错信息:

    1. 23/10/03 22:27:04 WARN fs.FileUtil: Failed to delete file or dir [/usr/data/hadoop/tmp/dfs/name/current/fsimage_0000000000000000000.md5]: it still exists.
    2. 23/10/03 22:27:04 WARN fs.FileUtil: Failed to delete file or dir [/usr/data/hadoop/tmp/dfs/name/current/seen_txid]: it still exists.
    3. 23/10/03 22:27:04 WARN fs.FileUtil: Failed to delete file or dir [/usr/data/hadoop/tmp/dfs/name/current/VERSION]: it still exists.
    4. 23/10/03 22:27:04 WARN fs.FileUtil: Failed to delete file or dir [/usr/data/hadoop/tmp/dfs/name/current/fsimage_0000000000000000000]: it still exists.
    5. 23/10/03 22:27:04 WARN namenode.NameNode: Encountered exception during format:
    6. java.io.IOException: Cannot remove current directory: /usr/data/hadoop/tmp/dfs/name/current
    7. at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:358)
    8. at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:571)
    9. at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:592)
    10. at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:185)
    11. at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1211)
    12. at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1655)
    13. at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1782)
    14. 23/10/03 22:27:04 ERROR namenode.NameNode: Failed to start namenode.
    15. java.io.IOException: Cannot remove current directory: /usr/data/hadoop/tmp/dfs/name/current
    16. at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:358)
    17. at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:571)
    18. at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:592)
    19. at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:185)
    20. at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1211)
    21. at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1655)
    22. at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1782)
    23. 23/10/03 22:27:04 INFO util.ExitUtil: Exiting with status 1: java.io.IOException: Cannot remove current directory: /usr/data/hadoop/tmp/dfs/name/current

    根��错误日志,问题出在删除 /usr/data/hadoop/tmp/dfs/name/current 目录上。请尝试以下方法解决该问题:

    1.权限检查:确保你拥有足够的权限来删除该目录。使用以下命令以root用户身份删除该目录:

    sudo rm -r /usr/data/hadoop/tmp/dfs/name/current

    执行完这一步正常情况下就可以直接执行第4步,如果不成功再往下执行

    2.检查文件系统:确保文件系统没有被挂载为只读模式。运行以下命令确认文件系统的状态:

    mount | grep /usr/data/hadoop

    3.清理临时文件:如果以上方法无效,尝试清理掉 /usr/data/hadoop/tmp 目录下的所有文件和子目录。

    sudo rm -r /usr/data/hadoop/tmp/*

    4.清理完成后,重新启动HDFS并进行格式化操作:

    1. hdfs namenode -format
    2. start-dfs.sh

    完美解决:

  • 相关阅读:
    前端设计模式——桥接模式
    【CVPR 2022】HDR-NeRF: High Dynamic Range Neural Radiance Fields
    MP3是如何诞生的?
    分类预测 | Matlab实现GA-RF遗传算法优化随机森林多输入分类预测
    贪心,动态规划的区别
    数据结构——八大排序算法(面试/数据结构期末考试-简单且详细)
    Android studio 升级常见报错
    Spring的 @ControllerAdvice 之 ResponseBodyAdvice对响应结果进行增强
    (原创)【B4A】一步一步入门06:Button,背景图片、渐变、圆角、FontAwesome(控件篇02)
    把苦难的时光删去:从小县城售货员到深圳IT白领的蜕变之路
  • 原文地址:https://blog.csdn.net/m0_74972727/article/details/133530970