Hadoop: small file archiving

Small file archiving

Insert image description here
1) Case practice
(1) YARN process needs to be started
[atguigu@hadoop102 hadoop-3.1.3]$ start-yarn.sh

(2) Archive files
Archive all files in the /user/atguigu/input directory into an archive file called input.har, and store the archived files in the /user/atguigu/output path.
[atguigu@hadoop102 hadoop-3.1.3]$ hadoop archive -archiveName input.har -p /user/atguigu/input /user/atguigu/output

(3) View the archive
[atguigu@hadoop102 hadoop-3.1.3]$ hadoop fs -ls har:///user/atguigu/output/input.har

(4) 解归档文目
[atguigu@hadoop102 hadoop-3.1.3]$ hadoop fs -cp har:/// user/atguigu/output/input.har/* /user/atguigu

Guess you like

Origin blog.csdn.net/weixin_45427648/article/details/131820152