Transfer file out from HDFS

前端 未结 5 1790
傲寒
傲寒 2021-02-01 21:34

I want to transfer files out from HDFS to local filesystem of a different server which is not in hadoop cluster but in the network.

I could have done:

         


        
5条回答
  •  半阙折子戏
    2021-02-01 21:56

    You could make use of webHDFS REST API to do that. Do a curl from the machine where you want to download the files.

    curl -i -L "http://namenode:50075/webhdfs/v1/path_of_the_file?op=OPEN" -o ~/destination
    

    Another approach could be to use the DataNode API through wget to do this :

    wget http://$datanode:50075/streamFile/path_of_the_file
    

    But, the most convenient way, IMHO, would be to use the NameNOde webUI. Since this machine is part of the network, you could just point your web browser to NameNode_Machine:50070. After that browse through the HDFS, open the file you want to download and click Download this file.

提交回复
热议问题