You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/06/02 03:58:13 UTC

ambari git commit: AMBARI-11541. Default configuration for NameNode threads produces warning on large machine (srimanth)

Repository: ambari
Updated Branches:
  refs/heads/trunk 51caa8a04 -> 6a9620ab4


AMBARI-11541. Default configuration for NameNode threads produces warning on large machine (srimanth)


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

Branch: refs/heads/trunk
Commit: 6a9620ab4a0e55e37ef00388592e4e5dba48a886
Parents: 51caa8a
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Mon Jun 1 18:49:23 2015 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Mon Jun 1 18:54:35 2015 -0700

----------------------------------------------------------------------
 .../resources/stacks/HDP/2.2/services/stack_advisor.py   |  5 ++++-
 .../stacks/HDPWIN/2.2/services/stack_advisor.py          |  4 +++-
 .../test/python/stacks/2.2/common/test_stack_advisor.py  | 11 +++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6a9620ab/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 b91ea9b..1e31662 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
@@ -88,6 +88,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 
   def recommendHDFSConfigurations(self, configurations, clusterData, services, hosts):
     putHdfsSiteProperty = self.putProperty(configurations, "hdfs-site", services)
+    putHdfsSitePropertyAttribute = self.putPropertyAttribute(configurations, "hdfs-site")
     putHdfsSiteProperty("dfs.datanode.max.transfer.threads", 16384 if clusterData["hBaseInstalled"] else 4096)
 
     dataDirsCount = 1
@@ -110,7 +111,9 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     nameNodeCores = 4
     if namenodeHosts is not None and len(namenodeHosts):
       nameNodeCores = int(namenodeHosts[0]['Hosts']['cpu_count'])
-    putHdfsSiteProperty("dfs.namenode.handler.count", 25*nameNodeCores)
+    putHdfsSiteProperty("dfs.namenode.handler.count", 25 * nameNodeCores)
+    if 25 * nameNodeCores > 200:
+      putHdfsSitePropertyAttribute("dfs.namenode.handler.count", "maximum", 25 * nameNodeCores)
 
     servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
     if ('ranger-hdfs-plugin-properties' in services['configurations']) and ('ranger-hdfs-plugin-enabled' in services['configurations']['ranger-hdfs-plugin-properties']['properties']):

http://git-wip-us.apache.org/repos/asf/ambari/blob/6a9620ab/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
index 103d60d..3b7c948 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
@@ -87,7 +87,9 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
     nameNodeCores = 4
     if namenodeHosts is not None and len(namenodeHosts):
       nameNodeCores = int(namenodeHosts[0]['Hosts']['cpu_count'])
-    putHdfsSiteProperty("dfs.namenode.handler.count", 25*nameNodeCores)
+    putHdfsSiteProperty("dfs.namenode.handler.count", 25 * nameNodeCores)
+    if 25 * nameNodeCores > 200:
+      putHdfsSitePropertyAttribute("dfs.namenode.handler.count", "maximum", 25 * nameNodeCores)
 
     servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
     if ('ranger-hdfs-plugin-properties' in services['configurations']) and ('ranger-hdfs-plugin-enabled' in services['configurations']['ranger-hdfs-plugin-properties']['properties']):

http://git-wip-us.apache.org/repos/asf/ambari/blob/6a9620ab/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 45614a1..3a641f1 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
@@ -2199,6 +2199,17 @@ class TestHDP22StackAdvisor(TestCase):
     self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, services, hosts)
     self.assertEqual("kms://http@myhost1:2222/kms", configurations["hdfs-site"]["properties"]["dfs.encryption.key.provider.uri"])
 
+    # Test 8 - Dynamic maximum for 'dfs.namenode.handler.count'
+    hosts['items'][1]['Hosts']['cpu_count'] = 9
+    self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, services, hosts)
+    self.assertEqual(str(9 * 25), configurations["hdfs-site"]["property_attributes"]["dfs.namenode.handler.count"]['maximum'])
+
+    # Test 9 - Dynamic maximum for 'dfs.namenode.handler.count'
+    configurations["hdfs-site"]["property_attributes"].pop("dfs.namenode.handler.count", None)
+    hosts['items'][1]['Hosts']['cpu_count'] = 4
+    self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, services, hosts)
+    self.assertTrue("dfs.namenode.handler.count" not in configurations["hdfs-site"]["property_attributes"])
+
   def test_validateTezConfigurationsEnv(self):
     configurations = {
         "yarn-site": {