fsck使用详解

作者: 专职掏大粪 | 来源:发表于2020-08-19 18:16 被阅读0次
    • 文件系统检查 可指定目录
    hadoop fsck /
    

    找到相关块所属的文件

    hadoop fsck -blockId blk_1073744391
    
    • 找到文件中包含的块儿
    hadoop fsck /user/file  -files -blocks -racks
    
    • 输出信息明细
    ....................................................................................................
    ...................Status: HEALTHY
     Total size:    147035537415 B (Total open files size: 360 B)
     Total dirs:    1720
     Total files:   3719
     Total symlinks:        0 (Files currently being written: 5)
     Total blocks (validated):  3876 (avg. block size 37934865 B) (Total open file blocks (not validated): 4)
     Minimally replicated blocks:   3876 (100.0 %)
     Over-replicated blocks:    0 (0.0 %)
     Under-replicated blocks:   15 (0.3869969 %)
     Mis-replicated blocks:     0 (0.0 %)
     Default replication factor:    3
     Average block replication: 2.9669762
     Corrupt blocks:        0
     Missing replicas:      105 (0.9047824 %)
     Number of data-nodes:      3
     Number of racks:       1
    FSCK ended at Wed Aug 19 18:09:03 CST 2020 in 102 milliseconds
    
    

    status:代表这次hdfs上block检测的结果
    Total size: 代表/目录下文件总大小
    Total dirs:代表检测的目录下总共有多少个目录
    Total files:代表检测的目录下总共有多少文件
    Total symlinks:代表检测的目录下有多少个符号连接
    Total blocks(validated):代表检测的目录下有多少个block块是有效的
    Minimally replicated blocks:代表拷贝的最小block块数
    Over-replicated blocks:指的是副本数大于指定副本数的block数量
    Under-replicated blocks:指的是副本数小于指定副本数的block数量
    Mis-replicated blocks:指丢失的block块数量
    Default replication factor: 3 指默认的副本数是3份(自身一份,需要拷贝两份)
    Missing replicas:丢失的副本数
    Number of data-nodes:有多少个节点
    Number of racks:有多少个机架
    Corrupt blocks : 坏块儿数

    解决 针对无副本和坏块,解决办法
    通过
    hadoop fsck -move
    hadoop fsck -delete 删除受影响的文件

    相关文章

      网友评论

        本文标题:fsck使用详解

        本文链接:https://www.haomeiwen.com/subject/jpnnrktx.html