webhdfs 使用shell下载文件

echo "test web hdfs how to use" >> foo.txt
hdfs dfs -put foo.txt /

HDFS启用webhdfs之后,可以在没有安装hadoop的机器上使用shell命令或cmd命令来获取文件:

例如windows机器上可以使用:

"C:\Program Files (x86)\Gow\bin\wget.exe" -O foo.txt http://nn1:50070/webhdfs/v1/foo.txt?op=OPEN

在linux的机器上可以使用:

wget -O foo.txt http://nn1:50070/webhdfs/v1/foo.txt?op=OPEN

官方文档中使用的curl 命令会产生一堆的协议反馈信息

posted on 2016-04-06 14:59  tneduts  阅读(1550)  评论(0编辑  收藏  举报

导航