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

hdfs基本操作命令

hdfs基本操作命令

命令可以用 hadoop fs 或者 hdfs dfs 开头。后者更新。

1. 查看文件夹中的文件

hadoop fs -ls /training

2. 创建目录

hadoop fs -mkdir -p /training/{student_name}/hdfs_data

3. 更改文件权限

hadoop fs -chmod -R 777 /training/{student_name}/hdfs_data

4. 上传文件

echo "Hello Hadoop File System,this is a message from physical world." > file01

hadoop fs -put file01 /training/{student_name}/hdfs_data

hadoop fs -ls /training/{student_name}/hdfs_data

7. 读取文件

hadoop fs -cat /training/{student_name}/hdfs_data/file01

也可通过webhdfs进行http restapi 操作

curl -H "Guardian-Access-Token:0Bf3ittHa8LcwLr6XYD8-TDH" -i -L "http://172.18.8.16:50070/webhdfs/v1/training/student_s/hdfs_data/file01?op=OPEN" 

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

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

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