linux中的jdk-6u24-linux-i586.bin是81M
[root@hadoop local]# du -sh *
211M hadoop
60M hadoop-1.1.2.tar.gz
250M jdk
81M jdk-6u24-linux-i586.bin
8.0K mydata
4.0K word2.txt
4.0K word.txt
将jdk-6u24-linux-i586.bin上传到HDFS中
[root@hadoop local]# hadoop fs -put jdk-6u24-linux-i586.bin /
通过hadoop fsck查看HDFS中jdk-6u24-linux-i586.bin文件对应的block块以及block块的分布情况
[root@hadoop local]# hadoop fsck /jdk-6u24-linux-i586.bin -files -blocks -locations -racks
FSCK started by root from /192.168.80.100 for path /jdk-6u24-linux-i586.bin at Mon Oct 10 05:37:20 PDT 2016
/jdk-6u24-linux-i586.bin 84927175 bytes, 2 block(s): OK
0. blk_-8238180044705517797_5753 len=67108864 repl=1 [/default-rack/192.168.80.100:50010]
1. blk_136889878628398312_5753 len=17818311 repl=1 [/default-rack/192.168.80.100:50010]
我们到DataNode存放数据的目录下查看一下:
[root@hadoop current]# ll
total 83592
-rw-r--r--. 1 root root 17818311 Oct 10 05:34 blk_136889878628398312
-rw-r--r--. 1 root root 139215 Oct 10 05:34 blk_136889878628398312_5753.meta
-rw-r--r--. 1 root root 67108864 Oct 10 05:34 blk_-8238180044705517797
-rw-r--r--. 1 root root 524295 Oct 10 05:34 blk_-8238180044705517797_5753.meta
或者
[root@hadoop current]# du -sh *
17M blk_136889878628398312
136K blk_136889878628398312_5753.meta
64M blk_-8238180044705517797
516K blk_-8238180044705517797_5753.meta
通过查看,我们发现文件的存储和我们的预想是相同的,说明HDFS中的文件归根到底是要存储到Linux文件系统中的。