ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [22/50] [abbrv] ambari git commit: AMBARI-22074 Confusing AMS collector heap size validation loop (dsen)
Date Mon, 02 Oct 2017 20:39:33 GMT
AMBARI-22074 Confusing AMS collector heap size validation loop (dsen)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b660bf1a30fd324d099f0cb3af1e525b4364a2d7
Parents: c7c62c0
Author: Dmytro Sen <dsen@apache.org>
Authored: Thu Sep 28 17:17:32 2017 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Thu Sep 28 17:17:32 2017 +0300

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 36 +++++---------------
 1 file changed, 8 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b660bf1a/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 0249ea2..5307176 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
@@ -1105,36 +1105,16 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 
   def validateAmsEnvConfigurations(self, properties, recommendedDefaults, configurations,
services, hosts):
 
-    ams_env = getSiteProperties(configurations, "ams-env")
-    mb = 1024 * 1024
-    gb = 1024 * mb
     validationItems = []
+    collectorHeapsizeDefaultItem = self.validatorLessThenDefaultValue(properties, recommendedDefaults,
"metrics_collector_heapsize")
+    validationItems.extend([{"config-name": "metrics_collector_heapsize", "item": collectorHeapsizeDefaultItem}])
+
+    ams_env = getSiteProperties(configurations, "ams-env")
     collector_heapsize = self.to_number(ams_env.get("metrics_collector_heapsize"))
-    amsCollectorHosts = self.getComponentHostNames(services, "AMBARI_METRICS", "METRICS_COLLECTOR")
-    for collectorHostName in amsCollectorHosts:
-      for host in hosts["items"]:
-        if host["Hosts"]["host_name"] == collectorHostName:
-          hostComponents = []
-          for service in services["services"]:
-            for component in service["components"]:
-              if component["StackServiceComponents"]["hostnames"] is not None:
-                if collectorHostName in component["StackServiceComponents"]["hostnames"]:
-                  hostComponents.append(component["StackServiceComponents"]["component_name"])
-
-          requiredMemory = self.getMemorySizeRequired(services, hostComponents, configurations)
-          unusedMemory = host["Hosts"]["total_mem"] * 1024 - requiredMemory # in bytes
-          collector_needs_increase = collector_heapsize * mb < 16 * gb
-
-          if unusedMemory > 4*gb and collector_needs_increase:  # warn user, if more than
4GB RAM is unused
-            recommended_collector_heapsize = int((unusedMemory - 4*gb)/5) + collector_heapsize
* mb
-            recommended_collector_heapsize = min(16*gb, recommended_collector_heapsize) #Make
sure heapsize <= 16GB
-            recommended_collector_heapsize = round_to_n(recommended_collector_heapsize/mb,128)
# Round to 128m multiple
-            if collector_heapsize < recommended_collector_heapsize:
-              validation_msg = "Consider allocating {0} MB to metrics_collector_heapsize
in ams-env to use up some " \
-                               "unused memory on host"
-              collectorHeapsizeItem = self.getWarnItem(validation_msg.format(recommended_collector_heapsize))
-              validationItems.extend([{"config-name": "metrics_collector_heapsize", "item":
collectorHeapsizeItem}])
-    pass
+    if collector_heapsize > 32768:
+      collectorHeapsizeMaxItem = self.getWarnItem("Value is more than the recommended maximum
heap size of 32G.")
+      validationItems.extend([{"config-name": "metrics_collector_heapsize", "item": collectorHeapsizeMaxItem}])
+
     return self.toConfigurationValidationProblems(validationItems, "ams-env")
 
   def getMemorySizeRequired(self, services, components, configurations):


Mime
View raw message