Browse Source

HADOOP-2894. Fix a problem to do with tasktrackers failing to connect to JobTracker upon reinitialization. Contributed by Owen O'Malley.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@631915 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 năm trước cách đây
mục cha
commit
feaa1a911c

+ 3 - 0
CHANGES.txt

@@ -153,6 +153,9 @@ Release 0.16.1 - Unreleased
     HADOOP-2852. Update gridmix benchmark to avoid an artifically long tail.
     (cdouglas)
 
+    HADOOP-2894. Fix a problem to do with tasktrackers failing to connect to
+    JobTracker upon reinitialization. (Owen O'Malley via ddas).
+
 Release 0.16.0 - 2008-02-07
 
   INCOMPATIBLE CHANGES

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

@@ -118,7 +118,7 @@ public class SecondaryNameNode implements FSConstants, Runnable {
 
     // The web-server port can be ephemeral... ensure we have the correct info
     infoPort = infoServer.getPort();
-    conf.set("dfs.secondary.http.bindAddress", infoBindAddress + ":" +infoPort); 
+    conf.set("dfs.secondary.http.address", infoBindAddress + ":" +infoPort); 
     LOG.info("Secondary Web-server up at: " + infoBindAddress + ":" +infoPort);
 
     //

+ 1 - 1
src/java/org/apache/hadoop/mapred/JobTracker.java

@@ -672,7 +672,7 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, JobSubmiss
     this.conf.set("mapred.job.tracker", (this.localMachine + ":" + this.port));
     LOG.info("JobTracker up at: " + this.port);
     this.infoPort = this.infoServer.getPort();
-    this.conf.set("mapred.job.tracker.http.bindAddress", 
+    this.conf.set("mapred.job.tracker.http.address", 
         infoBindAddress + ":" + this.infoPort); 
     LOG.info("JobTracker webserver: " + this.infoServer.getPort());
     this.systemDir = jobConf.getSystemDir();

+ 5 - 3
src/java/org/apache/hadoop/mapred/TaskTracker.java

@@ -151,6 +151,7 @@ public class TaskTracker
   private static final String SUBDIR = "taskTracker";
   private static final String CACHEDIR = "archive";
   private static final String JOBCACHE = "jobcache";
+  private JobConf originalConf;
   private JobConf fConf;
   private MapOutputFile mapOutputFile;
   private int maxCurrentMapTasks;
@@ -387,6 +388,7 @@ public class TaskTracker
    */
   synchronized void initialize() throws IOException {
     // use configured nameserver & interface to get local hostname
+    this.fConf = new JobConf(originalConf);
     this.localHostname =
       DNS.getDefaultHost
       (fConf.get("mapred.tasktracker.dns.interface","default"),
@@ -433,7 +435,7 @@ public class TaskTracker
 
     // get the assigned address
     this.taskReportAddress = taskReportServer.getListenerAddress();
-    this.fConf.set("mapred.task.tracker.report.bindAddress",
+    this.fConf.set("mapred.task.tracker.report.address",
         taskReportAddress.getHostName() + ":" + taskReportAddress.getPort());
     LOG.info("TaskTracker up at: " + this.taskReportAddress);
 
@@ -796,13 +798,13 @@ public class TaskTracker
    * Start with the local machine name, and the default JobTracker
    */
   public TaskTracker(JobConf conf) throws IOException {
+    originalConf = conf;
     maxCurrentMapTasks = handleDeprecatedMaxTasks(
                            conf.get("mapred.tasktracker.map.tasks.maximum"),
                            conf.get("mapred.tasktracker.tasks.maximum"), 2);
     maxCurrentReduceTasks = handleDeprecatedMaxTasks(
                          conf.get("mapred.tasktracker.reduce.tasks.maximum"),
                          conf.get("mapred.tasktracker.tasks.maximum"), 2);
-    this.fConf = conf;
     this.jobTrackAddr = JobTracker.getAddress(conf);
     this.mapOutputFile = new MapOutputFile();
     this.mapOutputFile.setConf(conf);
@@ -817,7 +819,7 @@ public class TaskTracker
     this.server = new StatusHttpServer(
                         "task", httpBindAddress, httpPort, httpPort == 0);
     workerThreads = conf.getInt("tasktracker.http.threads", 40);
-    this.shuffleServerMetrics = new ShuffleServerMetrics(fConf);
+    this.shuffleServerMetrics = new ShuffleServerMetrics(conf);
     server.setThreads(1, workerThreads);
     // let the jsp pages get to the task tracker, config, and other relevant
     // objects