1、上传文件到集群
小文件
[victor@node1 hadoop-2.8.2]$ bin/hdfs dfs -mkdir -p /user/victor/conf
[victor@node1 hadoop-2.8.2]$ bin/hdfs dfs -put etc/hadoop/*-site.xml /user/victor/conf
大文件
[victor@node1 hadoop-2.8.2]$ bin/hdfs dfs -put /opt/software/hadoop-2.8.2.tar.gz /user/victor/conf
2、上传文件后查看元数据和数据存放在什么位置
元数据
[victor@node1 current]$ pwd
/opt/module/hadoop-2.8.2/data/tmp/dfs/name/current
数据
[victor@node1 subdir0]$ pwd
/opt/module/hadoop-2.8.2/data/tmp/dfs/data/current/BP-2073889698-192.168.1.102-1517928608823/current/finalized/subdir0/subdir0
3、拼接
-rw-rw-r--. 1 victor victor 7 Feb 7 09:33 blk_1073741825
-rw-rw-r--. 1 victor victor 11 Feb 7 09:33 blk_1073741825_1001.meta
-rw-rw-r--. 1 victor victor 42 Feb 7 09:33 blk_1073741826
-rw-rw-r--. 1 victor victor 11 Feb 7 09:33 blk_1073741826_1002.meta
[victor@node1 subdir0]$ cat blk_1073741836>>tmpHdfs.file
[victor@node1 subdir0]$ cat blk_1073741837>>tmpHdfs.file
[victor@node1 subdir0]$ tar -xzvf tmpHdfs.file
4、下载
[victor@node1 hadoop-2.8.2]$ bin/hadoop fs -get /user/victor/conf/hadoop-2.8.2.tar.gz