Преглед на файлове

HADOOP-1482. Fix secondary namenode to roll info port. Contributed by Dhruba.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@547796 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting преди 18 години
родител
ревизия
81052f3d28
променени са 2 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 3 0
      CHANGES.txt
  2. 7 1
      src/java/org/apache/hadoop/dfs/SecondaryNameNode.java

+ 3 - 0
CHANGES.txt

@@ -137,6 +137,9 @@ Trunk (unreleased changes)
      tasktracker to not be able to find cached files.
      (Arun C Murthy via cutting)
 
+ 44. HADOOP-1482.  Fix secondary namenode to roll info port.
+     (Dhruba Borthakur via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

+ 7 - 1
src/java/org/apache/hadoop/dfs/SecondaryNameNode.java

@@ -98,11 +98,17 @@ public class SecondaryNameNode implements FSConstants, Runnable {
     //
     infoPort = conf.getInt("dfs.secondary.info.port", 50090);
     infoBindAddress = conf.get("dfs.secondary.info.bindAddress", "0.0.0.0");
-    infoServer = new StatusHttpServer("dfs", infoBindAddress, infoPort, false);
+    infoServer = new StatusHttpServer("dfs", infoBindAddress, infoPort, true);
     infoServer.setAttribute("name.secondary", this);
+    this.infoServer.setAttribute("name.conf", conf);
     infoServer.addServlet("getimage", "/getimage", GetImageServlet.class);
     infoServer.start();
 
+    // The web-server port can be ephemeral... ensure we have the correct info
+    infoPort = infoServer.getPort();
+    conf.setInt("dfs.secondary.info.port", infoPort);
+    LOG.info("Secondary Web-server up at: " + conf.get("dfs.secondary.info.port"));
+
     //
     // Initialize other scheduling parameters from the configuration
     //