From 7dee7f11f6709990a7a18bbbabdeb929ffde6b76 Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Fri, 21 Sep 2012 04:51:43 +0000 Subject: [PATCH] HDFS-3932. NameNode Web UI broken if the rpc-address is set to the wildcard. Contributed by Colin Patrick McCabe git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1388321 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/hadoop/net/NetUtils.java | 5 ++--- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/NameNodeHttpServer.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java index ac48a08da72..d61ac9b5023 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java @@ -355,9 +355,8 @@ public class NetUtils { } /** - * Returns the InetSocketAddress that a client can use to connect to the - * given listening address. This returns "hostname:port" of the server, - * or "127.0.0.1:port" when given a wildcard address of "0.0.0.0:port". + * Returns an InetSocketAddress that a client can use to connect to the + * given listening address. * * @param addr of a listener * @return socket address that a client can use to connect to the server. diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index c0632681545..c983dca445d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -251,6 +251,9 @@ Release 2.0.3-alpha - Unreleased HDFS-3949. NameNodeRpcServer#join should join on both client and server RPC servers. (eli) + HDFS-3932. NameNode Web UI broken if the rpc-address is set to the wildcard. + (Colin Patrick McCabe via eli) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java index a30afcec167..fe73c42e7b6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java @@ -140,7 +140,8 @@ public class NameNodeHttpServer { .getPort()); } httpServer.setAttribute(NAMENODE_ATTRIBUTE_KEY, nn); - httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY, nn.getNameNodeAddress()); + httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY, + NetUtils.getConnectAddress(nn.getNameNodeAddress())); httpServer.setAttribute(FSIMAGE_ATTRIBUTE_KEY, nn.getFSImage()); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); setupServlets(httpServer, conf);