0

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

当我启用 webhdfs 并进行测试时,我发现它总是重定向到未配置为数据节点的“localhost:50075”。

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 配置为:

10.56.219.32
10.56.219.33
10.56.219.34

有这方面的配置吗?

谢谢!

4

2 回答 2

1

好吧,这是 /etc/hosts 错误。

数据节点上的 /etc/hosts 是:

127.0.0.1   localhost datanode-1

将其更改为:

127.0.0.1   datanode-1 localhost

解决这个问题。

于 2015-12-01T05:12:08.383 回答
1

你需要在 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 文件并将其部署在集群中的所有节点上后,您需要重新启动集群。

于 2015-12-01T06:25:48.353 回答