HDFS 简介 和常用命令的使用

HDFS 简介 
  HDFS 是 hadoop Distributed  file system 的缩写,意为hadoop 分布式文件系统。是基于流数据模式访问和处理超大文件的需求而开发的,运行在廉价的商用服务器上。
  有以下特点:
     处理超大文件,可以处理和存储PB级的数据,在yahoo 已经运行了4096个节点的集群了。
  在hadoop file system 创建文件夹
  ./bin/hadoop fs -mkdir input
  把一个本地file文件夹下的文件上传到 新建的input文件夹下 hfs1.jpg
  ./bin/hadoop fs -put ~/file/student.txt input

  ./bin/hadoop fs -copyFromLocal /home/liucheng/file/student.copy.txt   input/student.copy.txt


  查看一下上传到input文件夹下的文件
  ./bin/hadoop fs -ls input
  查看一下上传后的文件内容
  ./bin/hadoop fs -cat input/student.txt
  把HDFS文件下载到本地 见图 hfd.jpg

  ./bin/hadoop fs -copyToLocal /user/liucheng/input/student.txt /home/liucheng/file/student.copy.txt


  删除hdfs上的文件夹或是内容
  ./bin/hadoop fs -rmr ouput
原文地址:https://www.cnblogs.com/java20130726/p/3218276.html