第三篇 linux安装hadoop集群(3)-运行Java程序
本篇 linux安装hadoop集群(4)-hdfs命令
1 监控界面
http://192.168.199.210:50070/explorer.html#/
2 列出目录
[[email protected] sbin]# hdfs dfs -ls /
[[email protected] sbin]# hadoop fs -ls /
3 创建目录
[[email protected] sbin]# hadoop fs -mkdir /chy-data
[[email protected] sbin]# hdfs dfs -mkdir /test
4 删除目录
[[email protected] sbin]# hdfs dfs -rmr /test
5 上传文件
[[email protected] sbin]# hdfs dfs -put /usr/chy/memo.cfg /chy-data
6 查看文件
[[email protected] sbin]# hdfs dfs -cat /chy-data/memo.cfg
7 删除文件
[[email protected] sbin]# hdfs dfs -rm /chy-data/memo.cfg
8 下载文件
[[email protected] sbin]# hdfs dfs -get /chy-data/memo.cfg /usr/chy/temp
注意:
如果/usr/chy/存在temp文件,下提示错误
如果/usr/chy/temp目录不存在,下载文件名称是temp
否则存在/usr/chy/temp目录,则temp目录中生成文件memo.cfg
[[email protected] sbin]# hdfs dfs -get /chy-data/memo.cfg /usr/chy/m.txt
下载memo.cfg重新命名为m.txt