yywx001 发表于 2016-12-5 09:10:37

【Hadoop十二】HDFS常用命令

1. 修改日志文件查看器

hdfs oev -i edits_0000000000000000081-0000000000000000089 -o edits.xml
cat edits.xml
  修改日志文件转储为xml格式的edits.xml文件,其中每条RECORD就是一个操作事务日志

2. fsimage查看HDFS中的块信息等

$hdfs oiv -i fsimage_0000000000000016539-o fsimage.fd -p FileDistribution maxSize 1000 step 5
$ cat fsimage.fd
 结果:
Processed 0 inodes.
SizeNumFiles
0137
2097152198
41943048
62914562
83886084
104857602
totalFiles = 351
totalDirectories = 283
totalBlocks = 214
totalSpace = 196413302
maxFileSize = 8945561
 
3. 查看HDFS上的文件和目录详细信息

hdfs oiv -i fsimage_0000000000000016539 -p XML -o fsimage.xml
cat fsimage.xml
 
页: [1]
查看完整版本: 【Hadoop十二】HDFS常用命令