You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vi...@apache.org on 2012/06/06 23:58:27 UTC

svn commit: r1347161 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/util/suggestProperties.php

Author: vikram
Date: Wed Jun  6 21:58:27 2012
New Revision: 1347161

URL: http://svn.apache.org/viewvc?rev=1347161&view=rev
Log:
AMBARI-386. On Single Node install when install all the components the recommended num for Map/Reduce Tasks is too high (Contributed by Hitesh)

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/php/util/suggestProperties.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347161&r1=1347160&r2=1347161&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Wed Jun  6 21:58:27 2012
@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-386. On Single Node install when install all the components the recommended num for Map/Reduce Tasks is too high (Hitesh via Vikram)
+
   AMBARI-279. On the mount points page show info on what the mount points are being used for (Yusaku via Vikram)
 
   AMBARI-387. Fine tune node assignment and propagate ZK host assignments to the frontend. (Mahadev via Vikram)

Modified: incubator/ambari/branches/ambari-186/hmc/php/util/suggestProperties.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/util/suggestProperties.php?rev=1347161&r1=1347160&r2=1347161&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/util/suggestProperties.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/util/suggestProperties.php Wed Jun  6 21:58:27 2012
@@ -214,21 +214,27 @@ class SuggestProperties {
 
     // set the num map/reduce tasks
     // assuming that there is atleast one host
-    $minCpuHost = $allHosts["hosts"][0];
-    $this->logger->log_info("Host Info with Min Cpu \n".print_r($minCpuHost, true));
-    $minCpus = $minCpuHost["cpuCount"];
-    $numMap = (int) (ceil ($minCpus/3 * 2 * 2)); // 2/3'rd of cpucount and multiply it by 2.
-    if ($numMap <= 0) {
-      $numMap = 1;
-    }
-    $numRed = ($minCpus * 2) - $numMap;
-    if ($numRed <= 0) {
-      $numRed = 1;
-    }
-    $this->logger->log_info("Num Maps ".$numMap ." Num Reduces ".$numRed);
-    $result["configs"]["mapred_map_tasks_max"] = $numMap;
-    $result["configs"]["mapred_red_tasks_max"] = $numRed;
-
+    if (count($allHosts["hosts"]) == 1) {
+      // for single node install use 2 maps and 2 reduce slots
+      $this->logger->log_info("Single node install: Using Num Maps 2, Num Reduces 2");
+      $result["configs"]["mapred_map_tasks_max"] = 2;
+      $result["configs"]["mapred_red_tasks_max"] = 2;
+    } else {
+      $minCpuHost = $allHosts["hosts"][0];
+      $this->logger->log_info("Host Info with Min Cpu \n".print_r($minCpuHost, true));
+      $minCpus = $minCpuHost["cpuCount"];
+      $numMap = (int) (ceil ($minCpus/3 * 2 * 2)); // 2/3'rd of cpucount and multiply it by 2.
+      if ($numMap <= 0) {
+        $numMap = 1;
+      }
+      $numRed = ($minCpus * 2) - $numMap;
+      if ($numRed <= 0) {
+        $numRed = 1;
+      }
+      $this->logger->log_info("Num Maps ".$numMap ." Num Reduces ".$numRed);
+      $result["configs"]["mapred_map_tasks_max"] = $numMap;
+      $result["configs"]["mapred_red_tasks_max"] = $numRed;
+    }
 
     /* suggest memory for all the needed master daemons */
     /* assume MR and HDFS are always selected */