栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

HDFS 入门(二) SHELL 命令------开发重点

HDFS 入门(二) SHELL 命令------开发重点

使用 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 ... 
#   生产环境更多
hadoop hdfs -get [-f] [-p] [-l] [-d]  ... 
三、直接操作hdfs



hadoop fs指令和linux本地指令中文件系统指令非常的相似。

	setrep是hadoop fs独有的。PS:每个节点至多只能存储一个副本
	当只有三台机器,但是设置了十个副本的话,实际只会存在三个副本。如果集群增加一个DataNode,副本数量会加一,直到十个。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/751559.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号