WebHDFS返回DataNode的主机名而不是IP地址

时间:2020-10-26 16:40:31

标签: api rest hdfs webhdfs

您好,我正在尝试通过使用webhdfs将文件上传到datanode。

    C:\Users\>curl -i -X PUT "http://<IP ADDRESS>/webhdfs/v1/user/hadoopuser?op=CREATE"
HTTP/1.1 307 Temporary Redirect
Date: Mon, 26 Oct 2020 16:16:43 GMT
Cache-Control: no-cache
Expires: Mon, 26 Oct 2020 16:16:43 GMT
Date: Mon, 26 Oct 2020 16:16:43 GMT
Pragma: no-cache
X-Content-Type-Options: nosniff
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Location: http://hadoop-sub2:9864/webhdfs/v1/user/hadoopuser?op=CREATE&namenoderpcaddress=hadoop-main:9000&createflag=&createparent=true&overwrite=false
Content-Type: application/octet-stream
Content-Length: 0

但是它不起作用..我认为hadoop-sub2:9864应该替换为

我有一个IP地址,例如分配给我的1.1.1.1。我已经将1.1.1.1:9864设置为sub2并更改了sub2的hdfs-site.xml

<property>
  <name>dfs.datanode.http.address</name>
      <value>1.1.1.1:9864</value>
</property>

但是它仍然不起作用。我应该修改什么?还是我应该为此获得另一个端口号?

0 个答案:

没有答案
相关问题