gpt4 book ai didi

Hadoop webhdfs curl 创建文件

转载 作者:可可西里 更新时间:2023-11-01 15:18:40 27 4
gpt4 key购买 nike

我使用 ubuntu 12,Hadoop 1.0.3,我使用 webhdfs curl 创建文件。

curl -i -X PUT "http://localhost:50070/webhdfs/v1/test.txt?op=CREATE

或使用

curl -i -X PUT -T /home/hadoop/TestFile/test.txt "http://localhost:50070/webhdfs/v1/test?op=CREATE"

两次表扬结果为

HTTP/1.1 307 TEMPORARY_REDIRECT

hdfs-site.xml 缺少什么设置?或者没有设置其他权限?

谢谢!

最佳答案

根据 Web HDFS 的文档,这是预期的:

当您进行第一次放置时,您将获得一个数据节点的临时重定向 URL,然后您可以向该地址发出另一个 PUT 命令以将文件实际上传到 HDFS。

文档还解释了这种两步创建方法背后的原因:

Note that the reason of having two-step create/append is for preventing clients to send out data before the redirect. This issue is addressed by the "Expect: 100-continue" header in HTTP/1.1; see RFC 2616, Section 8.2.3. Unfortunately, there are software library bugs (e.g. Jetty 6 HTTP server and Java 6 HTTP client), which do not correctly implement "Expect: 100-continue". The two-step create/append is a temporary workaround for the software library bugs.

关于Hadoop webhdfs curl 创建文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11064229/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com