ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-8209. Configs: YARN settings (aonishuk)
Date Fri, 07 Nov 2014 18:07:01 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 7120a2ff4 -> 1ad1ad656
  refs/heads/trunk b7fca7277 -> 4f2eefeae


AMBARI-8209. Configs: YARN settings (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4f2eefea
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4f2eefea
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4f2eefea

Branch: refs/heads/trunk
Commit: 4f2eefeae4a4dac717ad199a803d06119d0587f2
Parents: b7fca72
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Nov 7 20:06:52 2014 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Nov 7 20:06:52 2014 +0200

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |  3 ++-
 .../services/YARN/configuration/yarn-site.xml   |  2 +-
 .../stacks/HDP/2.2/services/stack_advisor.py    |  7 ++++++-
 .../stacks/2.2/common/test_stack_advisor.py     | 21 ++++++++++++++++++++
 4 files changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4f2eefea/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index ccbaeb3..9115fb3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -85,7 +85,8 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
     }
 
   def putProperty(self, config, configType):
-    config[configType] = {"properties": {}}
+    if configType not in config or "properties" not in config[configType]:
+      config[configType] = {"properties": {}}
     def appendProperty(key, value):
       config[configType]["properties"][key] = str(value)
     return appendProperty

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f2eefea/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
index 18c6e9a..b4f6558 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
@@ -233,7 +233,7 @@
   </property>
   <property>
     <name>yarn.timeline-service.ttl-enable</name>
-    <value>1</value>
+    <value>true</value>
     <description></description>
   </property>
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f2eefea/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index aa25bba..ac0d75d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -24,11 +24,16 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     childRecommendConfDict = {
       "HDFS": self.recommendHDFSConfigurations,
       "MAPREDUCE2": self.recommendMapReduce2Configurations,
-      "TEZ": self.recommendTezConfigurations
+      "TEZ": self.recommendTezConfigurations,
+      "YARN": self.recommendYARNConfigurations
     }
     parentRecommendConfDict.update(childRecommendConfDict)
     return parentRecommendConfDict
 
+  def recommendYARNConfigurations(self, configurations, clusterData):
+    super(HDP22StackAdvisor, self).recommendYARNConfigurations(configurations, clusterData)
+    putYarnProperty = self.putProperty(configurations, "yarn-site")
+    putYarnProperty('yarn.nodemanager.resource.cpu-vcores', clusterData['cpu'])
 
   def recommendHDFSConfigurations(self, configurations, clusterData):
     putHdfsPropery = self.putProperty(configurations, "hdfs-site")

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f2eefea/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index c5c31ee..2ba6d0d 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -479,3 +479,24 @@ class TestHDP22StackAdvisor(TestCase):
     expected = []  # No warnings
     validation_problems = self.stackAdvisor.validateHDFSConfigurations(properties, recommendedDefaults,
configurations)
     self.assertEquals(validation_problems, expected)
+
+  def test_recommendYARNConfigurations(self):
+    configurations = {}
+    clusterData = {
+      "cpu": 4,
+      "containers" : 5,
+      "ramPerContainer": 256
+    }
+    expected = {
+      "yarn-site": {
+        "properties": {
+          "yarn.nodemanager.resource.memory-mb": "1280",
+          "yarn.scheduler.minimum-allocation-mb": "256",
+          "yarn.scheduler.maximum-allocation-mb": "1280",
+          "yarn.nodemanager.resource.cpu-vcores": "4"
+        }
+      }
+    }
+
+    self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData)
+    self.assertEquals(configurations, expected)


Mime
View raw message