linux安装hadoop集群(4)-hdfs命令

第一篇 linux安装hadoop集群(1)-准备工作

第二篇 linux安装hadoop集群(2)-配置安装

第三篇 linux安装hadoop集群(3)-运行Java程序

本篇 linux安装hadoop集群(4)-hdfs命令

1 监控界面

http://192.168.199.210:50070/explorer.html#/

linux安装hadoop集群(4)-hdfs命令_第1张图片

2 列出目录

[root@hpmaster sbin]# hdfs dfs -ls /
[root@hpmaster sbin]# hadoop fs -ls /

3 创建目录

[root@hpmaster sbin]# hadoop fs -mkdir /chy-data
[root@hpmaster sbin]# hdfs dfs  -mkdir /test

4 删除目录

[root@hpmaster sbin]# hdfs dfs -rmr /test

5 上传文件

[root@hpmaster sbin]# hdfs dfs -put /usr/chy/memo.cfg  /chy-data

6 查看文件

[root@hpmaster sbin]# hdfs dfs -cat /chy-data/memo.cfg

7 删除文件

[root@hpmaster sbin]# hdfs dfs -rm /chy-data/memo.cfg

8 下载文件

[root@hpmaster sbin]# hdfs dfs -get /chy-data/memo.cfg /usr/chy/temp

注意:
如果/usr/chy/存在temp文件,下提示错误
如果/usr/chy/temp目录不存在,下载文件名称是temp
否则存在/usr/chy/temp目录,则temp目录中生成文件memo.cfg

[root@hpmaster sbin]# hdfs dfs -get /chy-data/memo.cfg /usr/chy/m.txt
下载memo.cfg重新命名为m.txt

你可能感兴趣的:(linux安装hadoop集群(4)-hdfs命令)