使用 hadoop fs 和直接使用hdfs dfs 是一样的 且dfs中的很多命令同Linux 一致。一、上传
# 1. 剪切 hadoop hdfs -moveFromLocal二、下载... # localsrc是Linux下的路径 # dst是dfs中的路径 # 2. 复制 hadoop hdfs -copyFromLocal ... # 生产环境更多 hadoop hdfs -put [-f] [-p] [-l] [-d] ... #Flags: #-p Preserves access and modification times, ownership and the mode. #-f Overwrites the destination if it already exists. #-l Allow DataNode to lazily persist the file to disk. Forces # replication factor of 1. This flag will result in reduced # durability. Use with care. #-d Skip creation of temporary file( ._COPYING_). # 3. 追加 -appendToFile ...
# 复制 hadoop hdfs -copyToLocal三、直接操作hdfs... # 生产环境更多 hadoop hdfs -get [-f] [-p] [-l] [-d] ...
hadoop fs指令和linux本地指令中文件系统指令非常的相似。
setrep是hadoop fs独有的。PS:每个节点至多只能存储一个副本 当只有三台机器,但是设置了十个副本的话,实际只会存在三个副本。如果集群增加一个DataNode,副本数量会加一,直到十个。



