hadoop fsck
Usage: DFSck <path> [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]
<path> 检查这个目录中的文件是否完整
-move 破损的文件移至/lost+found目录
-delete 删除破损的文件
-openforwrite 打印正在打开写操作的文件
-files 打印正在check的文件名
-blocks 打印block报告 (需要和-files参数一起使用)
-locations 打印每个block的位置信息(需要和-files参数一起使用)
-racks 打印位置信息的网络拓扑图 (需要和-files参数一起使用)
hadoop fsck /
用这个命令可以检查整个文件系统的健康状况,但是要注意它不会主动恢复备份缺失的block,这个是由NameNode单独的线程异步处理的。
....................................................................................................
.................................
/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/JIFEN.QQ.COM.2009-08-13-18.30: Replica placement policy is violated for blk_7596595208988121840_5377589. Block should be additionally replicated on 1 more rack(s).
....................................................
/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000310/input/PAY.QQ.COM.2009-08-13-20.30: Replica placement policy is violated for blk_8146588794511444453_5379501. Block should be additionally replicated on 1 more rack(s).
...............
....................................................................................................
....................................................................................................
.........................................................................................Status: HEALTHY
Total size: 5042961147529 B (Total open files size: 1610612736 B)
Total dirs: 723
Total files: 128089 (Files currently being written: 2)
Total blocks (validated): 171417 (avg. block size 29419259 B) (Total open file blocks (not validated): 24)
Minimally replicated blocks: 171417 (100.0 %)
Over-replicated blocks: 0 (0.0 %)
Under-replicated blocks: 0 (0.0 %)
Mis-replicated blocks: 476 (0.2776854 %)
Default replication factor: 3 缺省的备份参数3
Average block replication: 3.000146
Corrupt blocks: 0 破损的block数0
Missing replicas: 0 (0.0 %)
Number of data-nodes: 107
Number of racks: 4
The filesystem under path '/' is HEALTHY
hadoop fsck /user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/JIFEN.QQ.COM.2009-08-13-18.30 -files -blocks -locations -racks
打印出了这个文件每个block的详细信息包括datanode的机架信息。
/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/JIFEN.QQ.COM.2009-08-13-18.30 74110492 bytes, 2 block(s): Replica placement policy is violated for blk_7596595208988121840_5377589. Block should be additionally replicated on 1 more rack(s). 这个block虽然有三份拷贝,但是都在一个rack里,应该有一个副本放在不同的机架,详细见上一节(副本放置策略)
0. blk_-4839761191731553520_5377588 len=67108864 repl=3 [/lg/dminterface0/172.16.236.158:50010, /lg/dminterface1/172.16.218.108:50010, /lg/dminterface1/172.16.236.36:50010]
1. blk_7596595208988121840_5377589 len=7001628 repl=3 [/lg/dminterface2/172.16.236.51:50010, /lg/dminterface2/172.16.218.217:50010, /lg/dminterface2/172.16.218.200:50010]
三份拷贝的datanode信息,都在/lg/dminterface2里
Status: HEALTHY
Total size: 74110492 B
Total dirs: 0
Total files: 1
Total blocks (validated): 2 (avg. block size 37055246 B)
Minimally replicated blocks: 2 (100.0 %)
Over-replicated blocks: 0 (0.0 %)
Under-replicated blocks: 0 (0.0 %)
Mis-replicated blocks: 1 (50.0 %)
Default replication factor: 3
Average block replication: 3.0
Corrupt blocks: 0
Missing replicas: 0 (0.0 %)
Number of data-nodes: 107
Number of racks: 4
The filesystem under path '/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/JIFEN.QQ.COM.2009-08-13-18.30' is HEALTHY
分享到:
相关推荐
### Hadoop命令使用手册中文版知识点详解 #### 一、Hadoop概述 Hadoop是一款开源软件框架,主要用于处理大规模数据集(通常在集群环境中)。它能够高效地存储和处理非常大的数据集,使得用户能够在相对较低成本的...
### Hadoop大数据常用命令知识点详解 #### 一、启动与关闭Hadoop集群 **启动Hadoop** - **步骤**: 进入HADOOP_HOME目录,然后执行`sh bin/start-all.sh`。 - **作用**: 启动Hadoop集群,包括DataNodes和NameNode。...
### Hadoop命令指南详解 #### 一、概述 在深入探讨Hadoop命令的具体用法之前,我们先来了解一下Hadoop的基本概念以及如何调用这些命令。 **1.1 泛用选项** Hadoop提供了一套泛用选项,这些选项被多个命令支持。...
HDFS 基本操作详解 HDFS(Hadoop Distributed File System)是 Hadoop 生态系统中的一个核心组件,负责存储和管理大规模数据。作为一个分布式文件系统,HDFS 提供了高可靠性、可扩展性和高性能的存储解决方案。本文...
其中,/dev/xvdb1 是要挂载的设备,/usr/hadoop 是设备的挂载点,ext3 是设备文件系统类型,defaults 是默认设置,0 0 是数字设置,表示不可以 dump 备份和 fsck 检查顺序。 挂载新硬盘分区需要划分硬盘新区、格式...
**cramfs 文件系统详解** cramfs 是一个由 Linux 之父 Linus Torvalds 编写的只读、压缩的文件系统,主要用于嵌入式系统环境,它旨在有效地节省内存和外存资源。cramfs 的核心特性在于它的实时解压缩机制,当系统...
- **HDFS块检查命令fsck**:检查HDFS块完整性的命令。 - **HDFS如何检测并删除多余副本块**:HDFS维护数据块副本一致性的机制。 - **HDFS数据块的汇报与处理**:HDFS中数据块的状态报告和处理流程。 - **HDFS的流量...