Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C6A9A18582 for ; Sat, 9 Jan 2016 03:16:54 +0000 (UTC) Received: (qmail 16234 invoked by uid 500); 9 Jan 2016 03:16:54 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 16194 invoked by uid 500); 9 Jan 2016 03:16:54 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 16185 invoked by uid 99); 9 Jan 2016 03:16:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Jan 2016 03:16:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3362BE0667; Sat, 9 Jan 2016 03:16:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: odiachenko@apache.org To: commits@ambari.apache.org Message-Id: <25259b9f9b18449fa05dff4e5dc5ecc7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-14540. Fix single node installation issues for HAWQ(bhuvnesh chaudhary via odiachenko). Date: Sat, 9 Jan 2016 03:16:54 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk c484c905d -> 0c049aa71 AMBARI-14540. Fix single node installation issues for HAWQ(bhuvnesh chaudhary via odiachenko). Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0c049aa7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0c049aa7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0c049aa7 Branch: refs/heads/trunk Commit: 0c049aa710036c23bbef62e0f509635865b50718 Parents: c484c90 Author: Oleksandr Diachenko Authored: Fri Jan 8 19:16:43 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Jan 8 19:16:43 2016 -0800 ---------------------------------------------------------------------- .../common-services/HAWQ/2.0.0/package/scripts/params.py | 2 ++ .../HAWQ/2.0.0/package/templates/hawq-hosts.j2 | 4 +--- .../main/resources/stacks/HDP/2.3/services/stack_advisor.py | 7 +++---- ambari-web/app/controllers/wizard/step8_controller.js | 2 ++ ambari-web/app/models/stack_service_component.js | 5 ++++- ambari-web/test/controllers/wizard/step8_test.js | 6 +++++- 6 files changed, 17 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py index d92cc7f..4dc0874 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py @@ -55,6 +55,8 @@ hawq_password = config['configurations']['hawq-env']['hawq_password'] hawqmaster_host = __get_component_host('hawqmaster_hosts') hawqstandby_host = __get_component_host('hawqstandby_hosts') hawqsegment_hosts = default('/clusterHostInfo/hawqsegment_hosts', []) +hawq_master_hosts = [host for host in hawqmaster_host, hawqstandby_host if host] +hawq_all_hosts = set(hawq_master_hosts + hawqsegment_hosts) # HDFS http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2 b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2 index cdae3d8..e093375 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2 +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2 @@ -17,8 +17,6 @@ # under the License. # -{{hawqmaster_host}} -{{hawqstandby_host}} -{% for host in hawqsegment_hosts %} +{% for host in hawq_all_hosts %} {{host}} {% endfor %} http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py index 02c7482..dc64e24 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py @@ -65,8 +65,8 @@ class HDP23StackAdvisor(HDP22StackAdvisor): componentsListList = [service["components"] for service in services["services"]] componentsList = [item for sublist in componentsListList for item in sublist] - hawqMasterHosts = [component["StackServiceComponents"]["hostnames"][0] for component in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQMASTER"] - hawqStandbyHosts = [component["StackServiceComponents"]["hostnames"][0] for component in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQSTANDBY"] + hawqMasterHosts = [hostname for component in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQMASTER" for hostname in component["StackServiceComponents"]["hostnames"]] + hawqStandbyHosts = [hostname for component in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQSTANDBY" for hostname in component["StackServiceComponents"]["hostnames"]] # single node case is not analyzed because HAWQ Standby Master will not be present in single node topology due to logic in createComponentLayoutRecommendations() if len(hawqMasterHosts) == 1 and len(hawqStandbyHosts) == 1 and hawqMasterHosts == hawqStandbyHosts: @@ -590,8 +590,7 @@ class HDP23StackAdvisor(HDP22StackAdvisor): def isHawqMasterComponentOnAmbariServer(self, services): componentsListList = [service["components"] for service in services["services"]] componentsList = [item for sublist in componentsListList for item in sublist] - hawqMasterComponentHosts = [component["StackServiceComponents"]["hostnames"][0] for component in componentsList - if component["StackServiceComponents"]["component_name"] in ("HAWQMASTER", "HAWQSTANDBY")] + hawqMasterComponentHosts = [hostname for component in componentsList if component["StackServiceComponents"]["component_name"] in ("HAWQMASTER", "HAWQSTANDBY") for hostname in component["StackServiceComponents"]["hostnames"]] return any([self.isLocalHost(host) for host in hawqMasterComponentHosts]) http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index 89fed3c..ea79f5e 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -427,6 +427,8 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz if (component.get('isMaster') && !component.get('isShownOnInstallerAssignMasterPage')) return; // no HA component if (component.get('isHAComponentOnly')) return; + // skip if component is not allowed on single node cluster + if (Object.keys(this.get('content.hosts')).length == 1 && component.get('isNotAllowedOnSingleNodeCluster')) return; var displayName; if (component.get('isClient')) { displayName = Em.I18n.t('common.clients') http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-web/app/models/stack_service_component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js index bb18cc4..ea8e910 100644 --- a/ambari-web/app/models/stack_service_component.js +++ b/ambari-web/app/models/stack_service_component.js @@ -171,7 +171,10 @@ App.StackServiceComponent = DS.Model.extend({ }.property('componentName'), /** @property {Boolean} isNotAddableOnlyInInstall - is this component addable, except Install and Add Service Wizards **/ - isNotAddableOnlyInInstall: Em.computed.existsIn('componentName', ['HIVE_METASTORE', 'HIVE_SERVER', 'RANGER_KMS_SERVER', 'OOZIE_SERVER']) + isNotAddableOnlyInInstall: Em.computed.existsIn('componentName', ['HIVE_METASTORE', 'HIVE_SERVER', 'RANGER_KMS_SERVER', 'OOZIE_SERVER']), + + /** @property {Boolean} isNotAllowedOnSingleNodeCluster - is this component allowed on single node **/ + isNotAllowedOnSingleNodeCluster: Em.computed.existsIn('componentName', ['HAWQSTANDBY']) }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-web/test/controllers/wizard/step8_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js index 426038c..14b7293 100644 --- a/ambari-web/test/controllers/wizard/step8_test.js +++ b/ambari-web/test/controllers/wizard/step8_test.js @@ -504,7 +504,11 @@ describe('App.WizardStep8Controller', function () { var content = Em.Object.create({ services: services, selectedServices: selectedServices, - slaveComponentHosts: slaveComponentHosts + slaveComponentHosts: slaveComponentHosts, + hosts: Em.A([ + Em.Object.create({hostName: 'h1', isInstalled: true}), + Em.Object.create({hostName: 'h2', isInstalled: false}) + ]) }); installerStep8Controller.set('content', content); installerStep8Controller.set('services', Em.A([]));