|
|
@@ -272,36 +272,8 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
|
|
|
if siteProperties is not None:
|
|
|
resultItems = method(siteProperties, recommendedDefaults[siteName]["properties"], configurations, services, hosts)
|
|
|
items.extend(resultItems)
|
|
|
- clusterWideItems = self.validateClusterConfigurations(configurations, services, hosts)
|
|
|
- items.extend(clusterWideItems)
|
|
|
return items
|
|
|
|
|
|
- def validateClusterConfigurations(self, configurations, services, hosts):
|
|
|
- validationItems = []
|
|
|
- hostComponents = {}
|
|
|
- failureMessage = ""
|
|
|
-
|
|
|
- for service in services["services"]:
|
|
|
- for component in service["components"]:
|
|
|
- if component["StackServiceComponents"]["hostnames"] is not None:
|
|
|
- for hostName in component["StackServiceComponents"]["hostnames"]:
|
|
|
- if hostName not in hostComponents.keys():
|
|
|
- hostComponents[hostName] = []
|
|
|
- hostComponents[hostName].append(component["StackServiceComponents"]["component_name"])
|
|
|
-
|
|
|
- for host in hosts["items"]:
|
|
|
- # Not enough physical memory
|
|
|
- requiredMemory = getMemorySizeRequired(hostComponents[host["Hosts"]["host_name"]], configurations)
|
|
|
- if host["Hosts"]["total_mem"] * 1024 < requiredMemory: # in bytes
|
|
|
- failureMessage += "Not enough physical RAM on the host {0}. " \
|
|
|
- "At least {1} MB is recommended based on components assigned.\n" \
|
|
|
- .format(host["Hosts"]["host_name"], requiredMemory/1048576) # MB
|
|
|
- if failureMessage:
|
|
|
- notEnoughMemoryItem = self.getWarnItem(failureMessage)
|
|
|
- validationItems.extend([{"config-name": "", "item": notEnoughMemoryItem}])
|
|
|
-
|
|
|
- return self.toConfigurationValidationProblems(validationItems, "")
|
|
|
-
|
|
|
def getServiceConfigurationValidators(self):
|
|
|
return {
|
|
|
"HDFS": {"hadoop-env": self.validateHDFSConfigurationsEnv},
|
|
|
@@ -377,12 +349,16 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
|
|
|
masterHostItem = None
|
|
|
|
|
|
if masterItem is None:
|
|
|
+ hostComponents = {}
|
|
|
hostMasterComponents = {}
|
|
|
|
|
|
for service in services["services"]:
|
|
|
for component in service["components"]:
|
|
|
if component["StackServiceComponents"]["hostnames"] is not None:
|
|
|
for hostName in component["StackServiceComponents"]["hostnames"]:
|
|
|
+ if hostName not in hostComponents.keys():
|
|
|
+ hostComponents[hostName] = []
|
|
|
+ hostComponents[hostName].append(component["StackServiceComponents"]["component_name"])
|
|
|
if self.isMasterComponent(component):
|
|
|
if hostName not in hostMasterComponents.keys():
|
|
|
hostMasterComponents[hostName] = []
|
|
|
@@ -405,6 +381,18 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
|
|
|
masterHostMessage.format(
|
|
|
collectorHostName, str(", ".join(hostMasterComponents[collectorHostName]))))
|
|
|
|
|
|
+ # No enough physical memory
|
|
|
+ # TODO Add AMBARI_METRICS Collector Xmx property to ams-env
|
|
|
+ requiredMemory = getMemorySizeRequired(hostComponents[collectorHostName], configurations)
|
|
|
+ if host["Hosts"]["total_mem"] * 1024 < requiredMemory: # in bytes
|
|
|
+ message = "No enough total RAM on the host {0}, " \
|
|
|
+ "at least {1} MB required for the components({2})" \
|
|
|
+ .format(collectorHostName, requiredMemory/1048576,
|
|
|
+ str(", ".join(hostComponents[collectorHostName]))) # MB
|
|
|
+ regionServerItem = self.getErrorItem(message)
|
|
|
+ masterItem = self.getErrorItem(message)
|
|
|
+ break
|
|
|
+
|
|
|
validationItems = [{"config-name": "hbase_regionserver_heapsize", "item": regionServerItem},
|
|
|
{"config-name": "hbase_master_heapsize", "item": masterItem},
|
|
|
{"config-name": "hbase_master_heapsize", "item": masterHostItem},
|