AMBARI-20376. While Moving Namenode via Move Master wizard, datanodes reported as down (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/647ff84b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/647ff84b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/647ff84b Branch: refs/heads/trunk Commit: 647ff84b0b85b04bd350ddb268fde56b0778cf2b Parents: fbcf24f Author: Alex Antonenko <hiv...@gmail.com> Authored: Thu Mar 9 14:32:10 2017 +0200 Committer: Alex Antonenko <hiv...@gmail.com> Committed: Thu Mar 9 17:11:37 2017 +0200 ---------------------------------------------------------------------- .../controllers/main/service/reassign/step6_controller.js | 9 +++++++++ ambari-web/app/messages.js | 1 + .../app/mixins/wizard/wizardProgressPageController.js | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/647ff84b/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 80f1bf6..05494d4 100644 --- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js +++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js @@ -27,6 +27,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro 'putHostComponentsInMaintenanceMode', 'stopHostComponentsInMaintenanceMode', 'deleteHostComponents', + 'startDatanodes', 'startAllServices' ], @@ -97,6 +98,9 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro } else { this.removeTasks(['stopHostComponentsInMaintenanceMode']); } + if (!(this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled'))) { + this.removeTasks(['startDatanodes']); + } }, hideRollbackButton: function () { @@ -200,5 +204,10 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro success: 'startPolling', error: 'onTaskError' }); + }, + + startDatanodes: function () { + this.updateComponent('DATANODE', null, 'HDFS', 'Start'); } + }); http://git-wip-us.apache.org/repos/asf/ambari/blob/647ff84b/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index a0bc119..2e80a2b 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2429,6 +2429,7 @@ Em.I18n.translations = { 'services.reassign.step6.tasks.installPxf.title': 'Install PXF on NameNode', 'services.reassign.step6.tasks.stopMysqlService.title': 'Stop Mysql Server', 'services.reassign.step6.tasks.stopHostComponentsInMaintenanceMode.title': 'Stop {0}', + 'services.reassign.step6.tasks.startDatanodes.title': 'Start DataNodes', 'services.reassign.step6.status.success': 'Successfully moved <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host.', 'services.reassign.step6.status.failed': 'Failed to move <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host.', 'services.reassign.step6.status.info': 'Reassigning {0}. \nPlease wait for all tasks to be completed.', http://git-wip-us.apache.org/repos/asf/ambari/blob/647ff84b/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 ced5591..9d9d000 100644 --- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js +++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js @@ -604,14 +604,14 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, { * Update component status on selected hosts. * * @param {string} componentName - * @param {(string|string[])} hostName + * @param {(string|string[]|null)} hostName - use null to update components on all hosts * @param {string} serviceName * @param {string} context * @param {number} taskNum * @returns {$.ajax} */ updateComponent: function (componentName, hostName, serviceName, context, taskNum) { - if (!(hostName instanceof Array)) { + if (hostName && !(hostName instanceof Array)) { hostName = [hostName]; } var state = context.toLowerCase() == "start" ? "STARTED" : "INSTALLED"; @@ -622,7 +622,7 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, { HostRoles: { state: state }, - query: 'HostRoles/component_name=' + componentName + '&HostRoles/host_name.in(' + hostName.join(',') + ')&HostRoles/maintenance_state=OFF', + query: 'HostRoles/component_name=' + componentName + (hostName ? '&HostRoles/host_name.in(' + hostName.join(',') + ')' : '') + '&HostRoles/maintenance_state=OFF', context: context + " " + App.format.role(componentName, false), hostName: hostName, taskNum: taskNum || 1,