问题
行动
我们来到下面这个hadoop安装的目录下
[root@hadoop102 subdir0]# pwd
/opt/module/hadoop-2.7.7/data/tmp/dfs/data/current/BP-1961147429-192.168.1.102-1570287343868/current/finalized/subdir0/subdir0
[root@hadoop102 subdir0]#
查看一下目录下的文件
[root@hadoop102 subdir0]# ll
总用量 215280
-rw-r--r--. 1 root root 69 10月 6 13:17 blk_1073741825
-rw-r--r--. 1 root root 11 10月 6 13:17 blk_1073741825_1001.meta
-rw-r--r--. 1 root root 134217728 10月 6 13:18 blk_1073741826
-rw-r--r--. 1 root root 1048583 10月 6 13:18 blk_1073741826_1002.meta
-rw-r--r--. 1 root root 84502793 10月 6 13:18 blk_1073741827
-rw-r--r--. 1 root root 660187 10月 6 13:18 blk_1073741827_1003.meta
[root@hadoop102 subdir0]#
cat一下25这个文件,发现居然是我第一个上传的文件
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]# cat blk_1073741825
zhangsan lisi wangwu zhaosi
hh
shendu
zhenghui
aiyou
shendu
zhenghui
[root@hadoop102 subdir0]#
还原分块存储的文件
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]# cat blk_1073741826 >> tmp.txt
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]# cat blk_1073741827 >> tmp.txt
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]# ll
总用量 477296
-rw-r--r--. 1 root root 69 10月 6 13:17 blk_1073741825
-rw-r--r--. 1 root root 11 10月 6 13:17 blk_1073741825_1001.meta
-rw-r--r--. 1 root root 134217728 10月 6 13:18 blk_1073741826
-rw-r--r--. 1 root root 1048583 10月 6 13:18 blk_1073741826_1002.meta
-rw-r--r--. 1 root root 84502793 10月 6 13:18 blk_1073741827
-rw-r--r--. 1 root root 660187 10月 6 13:18 blk_1073741827_1003.meta
-rw-r--r--. 1 root root 218720521 10月 6 13:35 tmp.txt
[root@hadoop102 subdir0]#
还原
[root@hadoop102 subdir0]# tar -zxvf tmp.txt
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]#
[root@hadoop102 subdir0]# ll
总用量 477296
-rw-r--r--. 1 root root 69 10月 6 13:17 blk_1073741825
-rw-r--r--. 1 root root 11 10月 6 13:17 blk_1073741825_1001.meta
-rw-r--r--. 1 root root 134217728 10月 6 13:18 blk_1073741826
-rw-r--r--. 1 root root 1048583 10月 6 13:18 blk_1073741826_1002.meta
-rw-r--r--. 1 root root 84502793 10月 6 13:18 blk_1073741827
-rw-r--r--. 1 root root 660187 10月 6 13:18 blk_1073741827_1003.meta
drwxr-xr-x. 9 1000 ftp 149 7月 19 2018 hadoop-2.7.7
-rw-r--r--. 1 root root 218720521 10月 6 13:35 tmp.txt
[root@hadoop102 subdir0]#