Repository: ambari Updated Branches: refs/heads/trunk 162c10e95 -> 7eae3564f
AMBARI-11323. Enable NameNode HA Wizard: Call to install JOURNALNODE failed (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7eae3564 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7eae3564 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7eae3564 Branch: refs/heads/trunk Commit: 7eae3564f084e78746a0a28c2dea3edabbe6d832 Parents: 53c80e8 Author: Alex Antonenko <[email protected]> Authored: Fri May 22 01:33:17 2015 +0300 Committer: Alex Antonenko <[email protected]> Committed: Fri May 22 11:45:57 2015 +0300 ---------------------------------------------------------------------- .../nameNode/step5_controller.js | 22 ++++++++++++++++++-- ambari-web/app/utils/ajax/ajax.js | 5 +++++ 2 files changed, 25 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/7eae3564/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js index 039e3b3..b9ef309 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js @@ -22,7 +22,7 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont name:"highAvailabilityWizardStep5Controller", - commands: ['stopServices', 'installNameNode', 'installJournalNodes', 'reconfigureHDFS', 'startJournalNodes', 'disableSNameNode'], + commands: ['stopServices', 'installNameNode', 'checkJournalNodes', 'reconfigureHDFS', 'startJournalNodes', 'disableSNameNode'], hdfsSiteTag : "", coreSiteTag : "", @@ -32,6 +32,25 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont this.createComponent('NAMENODE', hostName, "HDFS"); }, + checkJournalNodes: function() { + App.ajax.send({ + name: 'admin.high_availability.check_journalnode', + sender: this, + success: 'onJournalNodeCheck', + error: 'onJournalNodeCheck' + }); + }, + + onJournalNodeCheck: function(data) { + if (!(Em.get(data, 'ServiceComponentInfo.state') === 'INSTALLED')) { + this.installJournalNodes(); + } + else { + var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName'); + this.createComponent('JOURNALNODE', hostNames, "HDFS"); + } + }, + installJournalNodes: function () { App.ajax.send({ name: 'admin.high_availability.create_journalnode', @@ -124,7 +143,6 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont onLoadConfigs: function(data) { var self = this; var configController = App.router.get('highAvailabilityWizardStep3Controller'); - var configData = $.extend({}, data); var configItems = data.items.map(function(item) { var fileName = Em.get(item, 'type'); var configTypeObject = self.get('content.serviceConfigProperties').items.findProperty('type', fileName); http://git-wip-us.apache.org/repos/asf/ambari/blob/7eae3564/ambari-web/app/utils/ajax/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js index 943c3f6..254e2a9 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -1284,6 +1284,11 @@ var urls = { } } }, + 'admin.high_availability.check_journalnode': { + 'real': '/clusters/{clusterName}/services/HDFS/components/JOURNALNODE?fields=ServiceComponentInfo/state', + 'mock': '' + }, + 'common.create_component': { 'real': '/clusters/{clusterName}/services?ServiceInfo/service_name={serviceName}', 'mock': '',
