hadoopwebhdfs创建我不能传送文件

lp0sw83n  于 2021-05-31  发布在  Hadoop
关注(0)|答案(1)|浏览(345)

我无法将文件传输到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"}}
kpbpu008

kpbpu0081#

请参见创建文件的第二步

curl -i -X PUT -T <LOCAL_FILE>

你错过了一个 -T ,它将您的文件作为url,格式不正确,因此

相关问题