Small file archiving
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