Repository: ambari Updated Branches: refs/heads/branch-2.2 b577dffa1 -> c740cc432
AMBARI-14284. Push yarn.resourcemanager.ha and yarn.resourcemanager.scheduler.ha properties when RM HA is enabled on cluster with 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/c740cc43 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c740cc43 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c740cc43 Branch: refs/heads/branch-2.2 Commit: c740cc432fda2de758aeba740c294bd44952af34 Parents: b577dff Author: Oleksandr Diachenko <[email protected]> Authored: Wed Dec 30 15:37:09 2015 -0800 Committer: Oleksandr Diachenko <[email protected]> Committed: Wed Dec 30 15:37:09 2015 -0800 ---------------------------------------------------------------------- .../resourceManager/step3_controller.js | 14 ++++++++++ .../resourceManager/step4_controller.js | 16 +++++++++--- ambari-web/app/data/HDP2/rm_ha_properties.js | 27 +++++++++++++++++++- ambari-web/app/messages.js | 3 ++- .../resourceManager/step3_controller_test.js | 18 +++++++++++++ 5 files changed, 73 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c740cc43/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js index 3db9c07..c9b5e12 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js @@ -153,6 +153,20 @@ App.RMHighAvailabilityWizardStep3Controller = Em.Controller.extend({ configProperties.pushObject(proxyUserConfig); proxyUserConfig.setProperties({'value': rmHosts, 'recommendedValue': rmHosts}); + + if (App.Service.find().someProperty('serviceName', 'HAWQ')) { + var yarnHAPort = 8032; + var yarnHAHosts = currentRMHost + ':' + yarnHAPort.toString() + ',' + additionalRMHost + ':' + yarnHAPort.toString(); + configProperties.findProperty('name', 'yarn.resourcemanager.ha') + .set('value', yarnHAHosts) + .set('recommendedValue', yarnHAHosts); + + var yarnHASchPort = 8030; + var yarnHASchHosts = currentRMHost + ':' + yarnHASchPort.toString() + ',' + additionalRMHost + ':' + yarnHASchPort.toString(); + configProperties.findProperty('name', 'yarn.resourcemanager.scheduler.ha') + .set('value', yarnHASchHosts) + .set('recommendedValue', yarnHASchHosts); + } }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/c740cc43/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js index 221e06b..d50273b 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js @@ -24,12 +24,18 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo name: "rMHighAvailabilityWizardStep4Controller", + commands: ['stopRequiredServices', 'installResourceManager', 'reconfigureYARN', 'reconfigureHDFS', 'reconfigureHAWQ', 'startAllServices'], clusterDeployState: 'RM_HIGH_AVAILABILITY_DEPLOY', - commands: ['stopRequiredServices', 'installResourceManager', 'reconfigureYARN', 'reconfigureHDFS', 'startAllServices'], - tasksMessagesPrefix: 'admin.rm_highAvailability.wizard.step', + initializeTasks: function () { + this._super(); + if (!App.Service.find().someProperty('serviceName', 'HAWQ')) { + this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHAWQ').get('id'), 1); + } + }, + stopRequiredServices: function () { this.stopServices(['HDFS']); }, @@ -43,6 +49,10 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo this.loadConfigsTags('yarn-site'); }, + reconfigureHAWQ: function () { + this.loadConfigsTags("yarn-client"); + }, + reconfigureHDFS: function () { this.loadConfigsTags('core-site'); }, @@ -90,7 +100,7 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo error: 'onTaskError' }); }, - + onSaveConfigs: function () { this.onTaskCompleted(); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/c740cc43/ambari-web/app/data/HDP2/rm_ha_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/rm_ha_properties.js b/ambari-web/app/data/HDP2/rm_ha_properties.js index cb8dd8c..e14db98 100644 --- a/ambari-web/app/data/HDP2/rm_ha_properties.js +++ b/ambari-web/app/data/HDP2/rm_ha_properties.js @@ -23,8 +23,10 @@ module.exports = displayName: 'MISC', configCategories: [ App.ServiceConfigCategory.create({ name: 'YARN', displayName: 'YARN'}), - App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'}) + App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'}), + App.ServiceConfigCategory.create({ name: 'HAWQ', displayName: 'HAWQ'}) ], + sites: ['yarn-site', 'hawq-site'], sites: ['yarn-site', 'core-site'], configs: [ /**********************************************HDFS***************************************/ @@ -174,6 +176,29 @@ module.exports = "category": "YARN", "filename": "yarn-site", serviceName: 'MISC' + }, + /**********************************************HAWQ***************************************/ + { + "name": "yarn.resourcemanager.ha", + "displayName": "yarn.resourcemanager.ha", + "description": "Comma separated yarn resourcemanager host addresses with port", + "isReconfigurable": false, + "recommendedValue": "", + "value": "", + "category": "HAWQ", + "filename": "yarn-client", + serviceName: 'MISC' + }, + { + "name": "yarn.resourcemanager.scheduler.ha", + "displayName": "yarn.resourcemanager.scheduler.ha", + "description": "Comma separated yarn resourcemanager scheduler addresses with port", + "isReconfigurable": false, + "recommendedValue": "", + "value": "", + "category": "HAWQ", + "filename": "yarn-client", + serviceName: 'MISC' } ] } http://git-wip-us.apache.org/repos/asf/ambari/blob/c740cc43/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 820d3c9..905197a 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1312,7 +1312,8 @@ Em.I18n.translations = { 'admin.rm_highAvailability.wizard.step4.task1.title': 'Install Additional ResourceManager', 'admin.rm_highAvailability.wizard.step4.task2.title': 'Reconfigure YARN', 'admin.rm_highAvailability.wizard.step4.task3.title': 'Reconfigure HDFS', - 'admin.rm_highAvailability.wizard.step4.task4.title': 'Start All Services', + 'admin.rm_highAvailability.wizard.step4.task4.title': 'Reconfigure HAWQ', + 'admin.rm_highAvailability.wizard.step4.task5.title': 'Start All Services', 'admin.rm_highAvailability.wizard.step4.notice.inProgress':'Please wait while ResourceManager HA is being deployed.', 'admin.rm_highAvailability.wizard.step4.notice.completed':'ResourceManager HA has been enabled successfully.', http://git-wip-us.apache.org/repos/asf/ambari/blob/c740cc43/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js index f702f64..4676f54 100644 --- a/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js +++ b/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js @@ -274,6 +274,12 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () { }), Em.Object.create({ name: 'yarn.resourcemanager.webapp.https.address.rm2' + }), + Em.Object.create({ + name: 'yarn.resourcemanager.ha' + }), + Em.Object.create({ + name: 'yarn.resourcemanager.scheduler.ha' }) ] }; @@ -295,10 +301,19 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () { }) ]; }); + + sinon.stub(App.Service, 'find', function () { + return [ + Em.Object.create({ + serviceName: 'HAWQ' + }) + ]; + }); }); afterEach(function () { App.HostComponent.find.restore(); + App.Service.find.restore(); }); it('setting new RM properties values', function () { @@ -320,6 +335,9 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () { expect(configs.configs.findProperty('name', 'yarn.resourcemanager.zk-address').get('value')).to.equal('h2:2181,h3:2181'); expect(configs.configs.findProperty('name', 'yarn.resourcemanager.zk-address').get('recommendedValue')).to.equal('h2:2181,h3:2181'); + + expect(configs.configs.findProperty('name', 'yarn.resourcemanager.ha').get('value')).to.equal('h0:8032,h1:8032'); + expect(configs.configs.findProperty('name', 'yarn.resourcemanager.scheduler.ha').get('recommendedValue')).to.equal('h0:8030,h1:8030'); }); });
