Jelajahi Sumber

AMBARI-469. Cap DataNode heap size. (Contributed by Mahadev)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347287 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 tahun lalu
induk
melakukan
c4184760c8
2 mengubah file dengan 10 tambahan dan 7 penghapusan
  1. 2 0
      CHANGES.txt
  2. 8 7
      hmc/php/util/suggestProperties.php

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-469. Cap DataNode heap size. (Mahadev via Vikram)
+
   AMBARI-467. Fix hive stop to escape $. (Mahadev via Vikram)
 
   AMBARI-446. Support Resume For Manage Services (Varun via Vikram)

+ 8 - 7
hmc/php/util/suggestProperties.php

@@ -63,14 +63,14 @@ class SuggestProperties {
   }
 
   function allocateHeapSizeWithMax($componentName, $hostRoles, $hostInfoMap,
-      $allHostsToComponents, $is32bit) {
+      $allHostsToComponents, $is32bit, $max) {
     $heapSizeT = $this->allocateHeapSizeForDaemon($componentName, $hostRoles, $hostInfoMap,
         $allHostsToComponents, $is32bit);
-    if ($heapSizeT > 3072) {
-      $heapSize = 3072;
+    if ($heapSizeT > $max) {
+      $heapSizeT = $max;
     }
 
-    $this->logger->log_info("Calculating Maxed Heap Size For ".$componentName ." $heapSizeT" );
+    $this->logger->log_info("Calculating Maxed Heap Size For ".$componentName ." $heapSizeT with max $max" );
     return $heapSizeT; 
   }
 
@@ -265,8 +265,9 @@ class SuggestProperties {
           $hostInfoMap, $allHostsToComponents, FALSE);
       $result["configs"]["hbase_master_heapsize"] = $hbaseHeap;
     }
-    $heapSize = $this->allocateHeapSizeForDaemon("DATANODE", $hostRoles,
-        $hostInfoMap, $allHostsToComponents, TRUE);
+    $heapSize = $this->allocateHeapSizeWithMax("DATANODE", $hostRoles,
+        $hostInfoMap, $allHostsToComponents, TRUE, 2048);
+    // cap the datanode heap size and hadoop heap size
     $result["configs"]["dtnode_heapsize"] = $heapSize;
     $result["configs"]["hadoop_heapsize"] = $heapSize;
 
@@ -275,7 +276,7 @@ class SuggestProperties {
     $heapSize = $this->allocateHeapSizeForDaemon("TASKTRACKER", $hostRoles,
         $hostInfoMap, $allHostsToComponents, TRUE);
     $heapSizeWithMax = $this->allocateHeapSizeWithMax("TASKTRACKER", $hostRoles,
-        $hostInfoMap, $allHostsToComponents, TRUE);
+        $hostInfoMap, $allHostsToComponents, TRUE, 3072);
     $this->logger->log_info("Maxed Heap Size for MR Child opts ".$heapSizeWithMax);
     $result["configs"]["mapred_child_java_opts_sz"] = $heapSizeWithMax;