本文介绍了webhdfs始终重定向到localhost:50075的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个hdfs集群(hadoop 2.7.1),其中有一个名称节点,一个辅助名称节点,3个数据节点.

I have a hdfs cluster (hadoop 2.7.1), with one namenode, one secondary namenode, 3 datanodes.

启用webhdfs并进行测试时,我发现它始终重定向到未配置为datanode的"localhost:50075".

When I enable webhdfs and test, I found it always redirect to "localhost:50075" which is not configured as datanodes.

csrd@secondarynamenode:~/lybica-hdfs-viewer$ curl -i -L "http://10.56.219.30:50070/webhdfs/v1/demo.zip?op=OPEN"
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Tue, 01 Dec 2015 03:29:21 GMT
Date: Tue, 01 Dec 2015 03:29:21 GMT
Pragma: no-cache
Expires: Tue, 01 Dec 2015 03:29:21 GMT
Date: Tue, 01 Dec 2015 03:29:21 GMT
Pragma: no-cache
Location: http://localhost:50075/webhdfs/v1/demo.zip?op=OPEN&namenoderpcaddress=10.56.219.30:9000&offset=0
Content-Type: application/octet-stream
Content-Length: 0
Server: Jetty(6.1.26)

curl: (7) Failed to connect to localhost port 50075: Connection refused

etc/hadoop/slaves配置为:

The etc/hadoop/slaves is configured as:

10.56.219.32
10.56.219.33
10.56.219.34

对此有任何配置吗?

谢谢!

推荐答案

您需要在hdfs-site.xml中拥有此条目

You need to have this entry in hdfs-site.xml

<property>
  <name>dfs.datanode.http.address</name>
  <value>0.0.0.0:50075</value>
</property>

在群集上的值应为0.0.0.0.更新hdfs-site.xml文件并将其部署在群集中的所有节点上之后,需要重新启动群集.

Value should be 0.0.0.0 on a cluster. You need to restart the cluster after updating hdfs-site.xml file and deploying it on all nodes in the cluster.

这篇关于webhdfs始终重定向到localhost:50075的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 02:29