gpt4 book ai didi

hadoop webhdfs 创建。我无法传输文件

转载 作者:可可西里 更新时间:2023-11-01 16:37:06 24 4
gpt4 key购买 nike

我无法将文件传输到 Hadoop。下面我添加我使用过的命令和得到的错误。

命令 1:

curl -i -X PUT "http://myip:50070/webhdfs/v1/tmp/tempForTest.txt?user.name=hadoop&op=CREATE&overwrite=false&createparent=false&replication=1&permission=777"

HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Wed, 18 Apr 2018 11:53:28 GMT
Date: Wed, 18 Apr 2018 11:53:28 GMT
Pragma: no-cache
Expires: Wed, 18 Apr 2018 11:53:28 GMT
Date: Wed, 18 Apr 2018 11:53:28 GMT
Pragma: no-cache
Set-Cookie: hadoop.auth="u=hadoop&p=hadoop&t=simple&e=1524088408729&s=A7TeYalAbDREoOHiJjh4YQZEhyk="; Path=/; Expires=Wed, 18-Apr-2018 21:53:28 GMT; HttpOnly
Location: http://hadoop-3:50075/webhdfs/v1/tmp/tempForTest.txt?op=CREATE&user.name=hadoop&namenoderpcaddress=hadoop-1:9000&overwrite=false&permission=777&replication=1
Content-Type: application/octet-stream
Content-Length: 0
Server: Jetty(6.1.26)

命令 2:

curl -i -X PUT /usr/local/hadoop-2.7.5/etc/hadoop/tmp/tempForTest.txt "http://hadoop-3:50075/webhdfs/v1/tmp/tempForTest.txt?user.name=hadoop&op=CREATE&overwrite=false&createparent=false&replication=1&permission=777"

curl: (3) <url> malformed
HTTP/1.1 100 Continue
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 161
Connection: close
{"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"java.net.UnknownHostException: null"}}

最佳答案

参见 second step to creating a file

curl -i -X PUT -T <LOCAL_FILE> 

您缺少 -T,它将您的文件作为格式错误的 URL,因此出现错误

关于hadoop webhdfs 创建。我无法传输文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49899424/

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