Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
hadoop webhdfs创建。我不能传送文件_Hadoop_Webhdfs - Fatal编程技术网

hadoop webhdfs创建。我不能传送文件

hadoop webhdfs创建。我不能传送文件,hadoop,webhdfs,Hadoop,Webhdfs,我无法将文件传输到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

我无法将文件传输到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"}}
curl-i-xput/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"
卷曲:(3)畸形
HTTP/1.1 100继续
HTTP/1.1400错误请求
内容类型:application/json;字符集=utf-8
内容长度:161
连接:关闭
{“RemoteException”:{“exception”:“IllegalArgumentException”,“javaClassName”:“java.lang.IllegalArgumentException”,“message”:“java.net.UnknownHostException:null”}
请参见

curl-i-X PUT-T

您缺少一个
-T
,并且它将您的文件作为URL,格式不正确,因此错误

基本上不确定您为什么要重新提交上一个问题
curl -i -X PUT -T <LOCAL_FILE>