Repository: ambari Updated Branches: refs/heads/branch-2.0.0 0af759d99 -> 85357a424
Revert "AMBARI-11019 AMS config warning message is confusing. (atkach)" This reverts commit 0af759d99bc9941faeffa16b8d85a3a4c4ebd0cd. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/85357a42 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/85357a42 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/85357a42 Branch: refs/heads/branch-2.0.0 Commit: 85357a424b4ff5870d36f70eb465d790ce8e2918 Parents: 0af759d Author: Yusaku Sako <[email protected]> Authored: Mon May 18 14:34:15 2015 -0700 Committer: Yusaku Sako <[email protected]> Committed: Mon May 18 14:34:15 2015 -0700 ---------------------------------------------------------------------- .../stacks/HDP/2.0.6/services/stack_advisor.py | 44 +++++++------------- ambari-web/app/messages.js | 1 - ambari-web/app/mixins/common/serverValidator.js | 11 ++--- .../configs/config_recommendation_popup.hbs | 16 +++---- 4 files changed, 24 insertions(+), 48 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/85357a42/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 ce90bc9..5e42b50 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 @@ -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}, http://git-wip-us.apache.org/repos/asf/ambari/blob/85357a42/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 0098c09..97adb7a 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -55,7 +55,6 @@ Em.I18n.translations = { 'ok':'OK', 'as':'as', 'on':'on', - 'in':'in', 'any': 'Any', 'more':'more', 'yes':'Yes', http://git-wip-us.apache.org/repos/asf/ambari/blob/85357a42/ambari-web/app/mixins/common/serverValidator.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js index ffd0d4b..c76e3d4 100644 --- a/ambari-web/app/mixins/common/serverValidator.js +++ b/ambari-web/app/mixins/common/serverValidator.js @@ -224,16 +224,11 @@ App.ServerValidatorMixin = Em.Mixin.create({ var message = { propertyName: item['config-name'], filename: item['config-type'], - warnMessage: item.message - }; - if (item['config-type'] === "" && item['config-name'] === "") { - //service-independent validation - message.isGeneral = true; - } else { - message.serviceName = App.StackService.find().filter(function(service) { + warnMessage: item.message, + serviceName: App.StackService.find().filter(function(service) { return !!service.get('configTypes')[item['config-type']]; })[0].get('displayName') - } + }; self.set(item.level == 'WARN' ? 'configValidationWarning' : 'configValidationError', true); globalWarning.push(message); } http://git-wip-us.apache.org/repos/asf/ambari/blob/85357a42/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs index 5283417..54fec3a 100644 --- a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs +++ b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs @@ -57,17 +57,11 @@ {{/each}} {{/each}} {{#each message in configValidationGlobalMessage}} - {{#if message.isGeneral}} - <tr> - <td colspan="4">{{message.warnMessage}}</td> - </tr> - {{else}} - <tr> - <td>{{message.serviceName}}</td> - <td>{{message.propertyName}}</td> - <td colspan="2">{{message.warnMessage}} {{t in}} {{message.filename}}</td> - </tr> - {{/if}} + <tr> + <td>{{message.serviceName}}</td> + <td>{{message.propertyName}}</td> + <td colspan="2">{{message.warnMessage}} in {{message.filename}}</td> + </tr> {{/each}} </tbody> </table>
