Repository: ambari Updated Branches: refs/heads/trunk 97e3de68f -> 0fa8238c7
AMBARI-19118 - Ranger Admin Start failed while enabling NameNode HA (rzang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0fa8238c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0fa8238c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0fa8238c Branch: refs/heads/trunk Commit: 0fa8238c7eda8a2b3fa826d8aafb97ee64f27e00 Parents: 97e3de6 Author: Richard Zang <rz...@apache.org> Authored: Wed Dec 7 15:31:33 2016 -0800 Committer: Richard Zang <rz...@apache.org> Committed: Wed Dec 7 15:33:08 2016 -0800 ---------------------------------------------------------------------- .../nameNode/step7_controller.js | 14 ++++++++++++-- .../nameNode/step9_controller.js | 17 +++++++---------- .../resourceManager/step4_controller.js | 5 +++-- .../main/service/reassign/step4_controller.js | 20 -------------------- .../main/service/reassign/step6_controller.js | 19 ------------------- ambari-web/app/messages.js | 7 ++++--- .../wizard/wizardProgressPageController.js | 20 ++++++++++++++++++++ 7 files changed, 46 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js index ae27506..9e14281 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js @@ -22,14 +22,24 @@ App.HighAvailabilityWizardStep7Controller = App.HighAvailabilityProgressPageCont name:"highAvailabilityWizardStep7Controller", - commands: ['startRanger', 'startZooKeeperServers', 'startNameNode'], + commands: ['startZooKeeperServers', 'startAmbariInfra', 'startRanger', 'startNameNode'], initializeTasks: function () { this._super(); + var tasksToRemove = []; + + if (!App.Service.find().someProperty('serviceName', 'AMBARI_INFRA')) { + tasksToRemove.push('startAmbariInfra'); + } if (!App.Service.find().someProperty('serviceName', 'RANGER')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'startRanger').get('id'), 1); + tasksToRemove.push('startRanger'); } + this.removeTasks(tasksToRemove); + }, + + startAmbariInfra: function () { + this.startServices(false, ['AMBARI_INFRA'], true); }, startRanger: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js index 3c220c1..713e1c3 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js @@ -31,30 +31,27 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont initializeTasks: function () { this._super(); - var numSpliced = 0; + var tasksToRemove = []; // find hostname where second namenode will be installed this.set('secondNameNodeHost', this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').findProperty('isInstalled', false).hostName); if (!App.Service.find().someProperty('serviceName', 'PXF') || this.isPxfComponentInstalled()) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'installPXF').get('id'), 1); - numSpliced = 1; + tasksToRemove.push('installPXF'); } if (!App.Service.find().someProperty('serviceName', 'RANGER')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureRanger').get('id') - numSpliced, 1); - numSpliced++; + tasksToRemove.push('reconfigureRanger'); } if (!App.Service.find().someProperty('serviceName', 'HBASE')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHBase').get('id') - numSpliced, 1); - numSpliced++; + tasksToRemove.push('reconfigureHBase'); } if (!App.Service.find().someProperty('serviceName', 'ACCUMULO')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureAccumulo').get('id') - numSpliced, 1); - numSpliced++ ; + tasksToRemove.push('reconfigureAccumulo'); } if (!App.Service.find().someProperty('serviceName', 'HAWQ')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHawq').get('id') - numSpliced, 1); + tasksToRemove.push('reconfigureHawq'); } + this.removeTasks(tasksToRemove); }, startSecondNameNode: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/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 722ae94..0495be9 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 @@ -32,10 +32,11 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo initializeTasks: function () { this._super(); - var numSpliced = 0; + var tasksToRemove = []; if (!App.Service.find().someProperty('serviceName', 'HAWQ')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHAWQ').get('id'), 1); + tasksToRemove.push('reconfigureHAWQ'); } + this.removeTasks(tasksToRemove); }, stopRequiredServices: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/ambari-web/app/controllers/main/service/reassign/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js index 64c2a8e..da7d2d9 100644 --- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js +++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js @@ -406,26 +406,6 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro }, /** - * remove tasks by command name - */ - removeTasks: function(commands) { - var tasks = this.get('tasks'); - - commands.forEach(function(command) { - var cmd = tasks.filterProperty('command', command); - var index = null; - - if (cmd.length === 0) { - return false; - } else { - index = tasks.indexOf( cmd[0] ); - } - - tasks.splice( index, 1 ); - }); - }, - - /** * initialize tasks */ initializeTasks: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/ambari-web/app/controllers/main/service/reassign/step6_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign/step6_controller.js b/ambari-web/app/controllers/main/service/reassign/step6_controller.js index 113686b..80f1bf6 100644 --- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js +++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js @@ -99,25 +99,6 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro } }, - /** - * remove tasks by command name - */ - removeTasks: function(commands) { - var tasks = this.get('tasks'); - - commands.forEach(function(command) { - var index; - tasks.forEach(function(_task, _index) { - if (_task.get('command') === command) { - index = _index; - } - }); - if (!Em.isNone(index)) { - tasks.splice(index, 1); - } - }, this); - }, - hideRollbackButton: function () { var failedTask = this.get('tasks').findProperty('showRollback'); if (failedTask) { http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 731b8e3..26f2ce5 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1429,9 +1429,10 @@ Em.I18n.translations = { 'admin.highAvailability.wizard.step5.task4.title':'Start JournalNodes', 'admin.highAvailability.wizard.step5.task5.title':'Disable Secondary NameNode', - 'admin.highAvailability.wizard.step7.task0.title':'Start Ranger', - 'admin.highAvailability.wizard.step7.task1.title':'Start ZooKeeper Servers', - 'admin.highAvailability.wizard.step7.task2.title':'Start NameNode', + 'admin.highAvailability.wizard.step7.task0.title':'Start ZooKeeper Servers', + 'admin.highAvailability.wizard.step7.task1.title':'Start Ambari Infra', + 'admin.highAvailability.wizard.step7.task2.title':'Start Ranger', + 'admin.highAvailability.wizard.step7.task3.title':'Start NameNode', 'admin.highAvailability.wizard.step9.task0.title':'Start Additional NameNode', 'admin.highAvailability.wizard.step9.task1.title':'Install Failover Controllers', http://git-wip-us.apache.org/repos/asf/ambari/blob/0fa8238c/ambari-web/app/mixins/wizard/wizardProgressPageController.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js index 3ee8a9a..d426eda 100644 --- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js +++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js @@ -272,6 +272,26 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, { } }, + /** + * remove tasks by command name + */ + removeTasks: function(commands) { + var tasks = this.get('tasks'); + + commands.forEach(function(command) { + var cmd = tasks.filterProperty('command', command); + var index = null; + + if (cmd.length === 0) { + return false; + } else { + index = tasks.indexOf( cmd[0] ); + } + + tasks.splice( index, 1 ); + }); + }, + setTaskStatus: function (taskId, status) { this.get('tasks').findProperty('id', taskId).set('status', status); },