显示HDFS存储信息

2020-12-31 11:39:32 浏览数 (1)

显示文件数

代码语言:javascript复制
hdfs dfs -count -q /spark2-history

image.png

显示文件夹下文件总大小 -s -h

代码语言:javascript复制
hdfs dfs -du -s -h  /spark2-history

image.png

显示文件由那些块构成

代码语言:javascript复制
hdfs fsck /spark2-history/application_1608084068201_452033_1 -files   -blocks  -racks

显示文件由那些块构成 -files:显示文件的文件名称、大小、块数量及是否可用; -blocks: 显示每个块在文件中的信息,一个块用一行显示; -racks: 展示了每个块所处的机架位置及DataNode的位置;

代码语言:javascript复制
Connecting to namenode via http://bigdata002.yyy.com.cn:50070/fsck?ugi=hdfs&files=1&blocks=1&racks=1&path=/spark2-history/application_1608084068201_452033_1
FSCK started by hdfs (auth:KERBEROS_SSL) from /172.16.255.20 for path /spark2-history/application_1608084068201_452033_1 at Mon Dec 28 21:47:50 CST 2020
/spark2-history/application_1608084068201_452033_1 1692130 bytes, 1 block(s):  OK
0. BP-86590029-172.16.255.20-1578389062797:blk_2163930329_1090575119 len=1692130 Live_repl=2 [/default-rack/172.16.254.158:1019, /default-rack/172.16.254.138:1019]

Status: HEALTHY
 Total size:    1692130 B
 Total dirs:    0
 Total files:   1
 Total symlinks:        0
 Total blocks (validated):  1 (avg. block size 1692130 B)
 Minimally replicated blocks:   1 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:   0 (0.0 %)
 Mis-replicated blocks:     0 (0.0 %)
 Default replication factor:    2
 Average block replication: 2.0
 Corrupt blocks:        0
 Missing replicas:      0 (0.0 %)
 Number of data-nodes:      100
 Number of racks:       1
FSCK ended at Mon Dec 28 21:47:50 CST 2020 in 14 milliseconds


The filesystem under path '/spark2-history/application_1608084068201_452033_1' is HEALTHY

0 人点赞