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 3D7D318234 for ; Wed, 6 Jan 2016 00:02:28 +0000 (UTC) Received: (qmail 27882 invoked by uid 500); 6 Jan 2016 00:02:28 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 27851 invoked by uid 500); 6 Jan 2016 00:02:28 -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 27842 invoked by uid 99); 6 Jan 2016 00:02:28 -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; Wed, 06 Jan 2016 00:02:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 05F3FE03E8; Wed, 6 Jan 2016 00:02:28 +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: <3e4a888d5da04f778fec1f9c20ba603b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-14528. Hawq yarn-client.xml HA parameters should be shown on UI if yarn rm ha is enabled (Bhuvnesh Chaudhary via odiachenko). Date: Wed, 6 Jan 2016 00:02:28 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 5d8a97cfb -> c0efc80d8 AMBARI-14528. Hawq yarn-client.xml HA parameters should be shown on UI if yarn rm ha is enabled (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/c0efc80d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c0efc80d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c0efc80d Branch: refs/heads/trunk Commit: c0efc80d8b920473ade027a1383e9b92f2d6f28f Parents: 5d8a97c Author: Oleksandr Diachenko Authored: Tue Jan 5 16:02:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Tue Jan 5 16:02:20 2016 -0800 ---------------------------------------------------------------------- .../app/controllers/wizard/step7_controller.js | 55 ++++++++++++++++++-- .../test/controllers/wizard/step7_test.js | 39 ++++++++++++++ 2 files changed, 91 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c0efc80d/ambari-web/app/controllers/wizard/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index a72c6d7..1cc852f 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -688,9 +688,14 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E if (this.get('allSelectedServiceNames').contains('YARN')) { configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml', []); } - // if HA is enabled and HAWQ is selected to be installed -> Add HAWQ related configs - if (this.get('wizardController.name') === 'addServiceController' && App.get('isHaEnabled') && this.get('allSelectedServiceNames').contains('HAWQ')) { - this.addHawqConfigsOnNnHa(configs); + // If Hawq service is being added, add NN/RM HA related parameter to hdfs-client/yarn-client respectively if applicable + if (this.get('wizardController.name') == 'addServiceController' && this.get('allSelectedServiceNames').contains('HAWQ')) { + if (App.get('isHaEnabled')) { + this.addHawqConfigsOnNnHa(configs); + } + if (App.get('isRMHaEnabled')) { + this.addHawqConfigsOnRMHa(configs); + } } if (App.get('isKerberosEnabled') && this.get('wizardController.name') == 'addServiceController') { this.addKerberosDescriptorConfigs(configs, this.get('wizardController.kerberosDescriptorConfigs') || []); @@ -797,6 +802,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E return stepConfigs; }, + /** * For Namenode HA, HAWQ service requires additional config parameters in hdfs-client.xml * This method ensures that these additional parameters are added to hdfs-client.xml @@ -836,6 +842,49 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E }, /** + * For ResourceManager HA, HAWQ service requires additional config parameters in yarn-client.xml + * This method ensures that these additional parameters are added to yarn-client.xml + * @param configs existing configs on cluster + * @returns {Object[]} existing configs + additional config parameters in yarn-client.xml + * @private + */ + addHawqConfigsOnRMHa: function(configs) { + rmHost1 = configs.findProperty('id', 'yarn.resourcemanager.hostname.rm1__yarn-site').value ; + rmHost2 = configs.findProperty('id', 'yarn.resourcemanager.hostname.rm2__yarn-site').value ; + var yarnConfigToBeAdded = [ + { + propertyName: 'yarn.resourcemanager.ha', + displayName: 'yarn.resourcemanager.ha', + description: 'Comma separated yarn resourcemanager host addresses with port', + port: '8032' + }, + { + propertyName: 'yarn.resourcemanager.scheduler.ha', + displayName: 'yarn.resourcemanager.scheduler.ha', + description: 'Comma separated yarn resourcemanager scheduler addresses with port', + port: '8030' + } + ] + + yarnConfigToBeAdded.forEach(function(propertyDetails) { + var newProperty = App.config.createDefaultConfig(propertyDetails.propertyName, 'HAWQ', 'yarn-client.xml', true); + var value = rmHost1 + ':' + propertyDetails.port + ',' + rmHost2 + ':' + propertyDetails.port; + Em.setProperties(newProperty, { + name: propertyDetails.name, + description: propertyDetails.description, + displayName: propertyDetails.displayName, + isOverridable: false, + isReconfigurable: false, + value: value, + recommendedValue: value + }); + + configs.push(App.ServiceConfigProperty.create(newProperty)); + }); + return configs; + }, + + /** * render configs, distribute them by service * and wrap each in ServiceConfigProperty object * @param stepConfigs http://git-wip-us.apache.org/repos/asf/ambari/blob/c0efc80d/ambari-web/test/controllers/wizard/step7_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index a54cc5d..548e231 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1702,6 +1702,45 @@ describe('App.InstallerStep7Controller', function () { }); }); + describe('#addHawqConfigsOnRMHa', function () { + var configs = [ + { + id: 'yarn.resourcemanager.hostname.rm1__yarn-site', + name: 'yarn.resourcemanager.hostname.rm1', + value: 'c6401.ambari.apache.org', + recommendedValue: 'c6401.ambari.apache.org' + }, + { + id: 'yarn.resourcemanager.hostname.rm2__yarn-site', + name: 'yarn.resourcemanager.hostname.rm2', + value: 'c6402.ambari.apache.org', + recommendedValue: 'c6402.ambari.apache.org' + } + ]; + + it('should update properties in yarn-client for HAWQ if yarn ha is enabled', function() { + var inputConfigsCount = configs.length; + installerStep7Controller.addHawqConfigsOnRMHa(configs); + var yarnRmDetails = configs.findProperty('id', 'yarn.resourcemanager.ha__yarn-client'); + var yarnRmSchedulerDetails = configs.findProperty('id', 'yarn.resourcemanager.scheduler.ha__yarn-client'); + + var expectedYarnRmHaValue = 'c6401.ambari.apache.org:8032,c6402.ambari.apache.org:8032'; + expect(yarnRmDetails.value).to.be.eql(expectedYarnRmHaValue); + expect(yarnRmDetails.recommendedValue).to.be.eql(expectedYarnRmHaValue); + expect(yarnRmDetails.displayName).to.be.eql('yarn.resourcemanager.ha'); + expect(yarnRmDetails.description).to.be.eql('Comma separated yarn resourcemanager host addresses with port'); + + var expectedYarnRmSchedulerValue = 'c6401.ambari.apache.org:8030,c6402.ambari.apache.org:8030'; + expect(yarnRmSchedulerDetails.value).to.be.eql(expectedYarnRmSchedulerValue); + expect(yarnRmSchedulerDetails.recommendedValue).to.be.eql(expectedYarnRmSchedulerValue); + expect(yarnRmSchedulerDetails.displayName).to.be.eql('yarn.resourcemanager.scheduler.ha'); + expect(yarnRmSchedulerDetails.description).to.be.eql('Comma separated yarn resourcemanager scheduler addresses with port'); + + var noOfConfigsAdded = 2; + expect(configs.length).to.be.eql(inputConfigsCount + noOfConfigsAdded) ; + }); + }); + describe('#errorsCount', function () { it('should ignore configs with widgets (enhanced configs)', function () {