How to use webhdfs rest api to copy a file and store it in the another directory?

廉价感情. 提交于 2020-06-18 12:36:30

问题


How to use httpfs to copy a file in to another directory in hdfs. for example, I can use (http://1.12.134.1234:2020/webhdfs/v1/user/xx/x?op=create&user=hello) to create a file. I did not find in https://hadoop.apache.org/docs/stable2/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#File_and_Directory_Operations


回答1:


There is no webhdfs 'copy'command. Use hadoop distcp command (or retrieve contents, create new file, write the contents if the file is expected to be a smallish one). Copy a file using WebHDFS also answers the question.



来源:https://stackoverflow.com/questions/39387512/how-to-use-webhdfs-rest-api-to-copy-a-file-and-store-it-in-the-another-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!