You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2013/10/16 17:50:44 UTC

git commit: AMBARI-3526 Reassign Master: HDFS service check fails after Namenode reassignment with HA enabled. (akovalenko)

Updated Branches:
  refs/heads/trunk 24dbefe24 -> 37bd63fc5


AMBARI-3526 Reassign Master: HDFS service check fails after Namenode reassignment with HA enabled. (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/37bd63fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/37bd63fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/37bd63fc

Branch: refs/heads/trunk
Commit: 37bd63fc519f26eb214ff25b7abda8126e1bfc58
Parents: 24dbefe
Author: Aleksandr Kovalenko <ol...@ukr.net>
Authored: Wed Oct 16 18:48:53 2013 +0300
Committer: Aleksandr Kovalenko <ol...@ukr.net>
Committed: Wed Oct 16 18:48:53 2013 +0300

----------------------------------------------------------------------
 .../highAvailability/progress_controller.js     | 21 +++++++++++++++
 .../main/service/reassign/step4_controller.js   | 27 ++++++++++++++++++--
 ambari-web/app/messages.js                      | 23 ++++++++++++-----
 ambari-web/app/routes/reassign_master_routes.js |  3 ++-
 .../views/main/service/reassign/step5_view.js   |  3 ++-
 5 files changed, 66 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/37bd63fc/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
index 8096709..7baab66 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -324,6 +324,27 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
     }
   },
 
+  stopComponent: function (componentName, hostName) {
+    console.warn('func: stopComponent');
+    if (!(hostName instanceof Array)) {
+      hostName = [hostName];
+    }
+    for (var i = 0; i < hostName.length; i++) {
+      App.ajax.send({
+        name: 'admin.high_availability.stop_component',
+        sender: this,
+        data: {
+          hostName: hostName[i],
+          componentName: componentName,
+          displayName: App.format.role(componentName),
+          taskNum: hostName.length
+        },
+        success: 'startPolling',
+        error: 'onTaskError'
+      });
+    }
+  },
+
   startPolling: function (data) {
     if (data) {
       console.warn('func: startPolling1');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/37bd63fc/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 d5f1afa..66b42d6 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -22,7 +22,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
 
   isReassign: true,
 
-  commands: ['stopServices', 'createHostComponents', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'installHostComponents', 'deleteHostComponents', 'startServices'],
+  commands: ['stopNameNode', 'stopServices', 'createHostComponents', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'installHostComponents', 'startZooKeeperServers', 'startNameNode', 'deleteHostComponents', 'startServices'],
 
   clusterDeployState: 'REASSIGN_MASTER_INSTALLING',
 
@@ -67,7 +67,15 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     }
 
     if (this.get('content.hasManualSteps')) {
-      this.get('tasks').splice(5, 2);
+      if (App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
+        this.get('tasks').splice(6, 4);
+        this.get('tasks').splice(0, 1);
+      } else {
+        this.get('tasks').splice(8, 2);
+      }
+    } else {
+      this.get('tasks').splice(6, 2);
+      this.get('tasks').splice(0, 1);
     }
   },
 
@@ -85,6 +93,11 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     }
   },
 
+  stopNameNode: function () {
+    var hostName = this.get('content.reassignHosts.source');
+    this.stopComponent('NAMENODE', hostName);
+  },
+
   stopServices: function () {
     App.ajax.send({
       name: 'reassign.stop_services',
@@ -279,6 +292,16 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     }
   },
 
+  startZooKeeperServers: function () {
+    var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
+    this.startComponent('ZOOKEEPER_SERVER', hostNames);
+  },
+
+  startNameNode: function () {
+    var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName').without(this.get('content.reassignHosts.target'));
+    this.startComponent('NAMENODE', hostName);
+  },
+
   startServices: function () {
     App.ajax.send({
       name: 'reassign.start_services',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/37bd63fc/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9117048..9fcdd81 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1076,13 +1076,16 @@ Em.I18n.translations = {
   'services.reassign.step3.sourceHost':'Source Host:',
   'services.reassign.step3.component':'Component name:',
   'services.reassign.step4.header':'Install, Start and Test',
-  'services.reassign.step4.task0.title':'Stop All Services',
-  'services.reassign.step4.task1.title':'{0} create',
-  'services.reassign.step4.task2.title':'{0} disable',
-  'services.reassign.step4.task3.title':'{0} reconfigure',
-  'services.reassign.step4.task4.title':'{0} install',
-  'services.reassign.step4.task5.title':'{0} remove',
-  'services.reassign.step4.task6.title':'Start All Services',
+  'services.reassign.step4.task0.title':'Stop NameNode',
+  'services.reassign.step4.task1.title':'Stop All Services',
+  'services.reassign.step4.task2.title':'{0} create',
+  'services.reassign.step4.task3.title':'{0} disable',
+  'services.reassign.step4.task4.title':'{0} reconfigure',
+  'services.reassign.step4.task5.title':'{0} install',
+  'services.reassign.step4.task6.title':'Start ZooKeeper Servers',
+  'services.reassign.step4.task7.title':'Start NameNode',
+  'services.reassign.step4.task8.title':'{0} remove',
+  'services.reassign.step4.task9.title':'Start All Services',
   'services.reassign.step4.status.success': 'Successfully reassigned {0}',
   'services.reassign.step4.status.success.withManualSteps': 'Proceed to the next step',
   'services.reassign.step4.status.failed': 'Failed to reassign {0}',
@@ -1098,6 +1101,12 @@ Em.I18n.translations = {
       '<div class="code-snippet">mkdir -p /var/run/hadoop/hdfs/namenode/formatted</div></li>' +
       '<li>Proceed next' +
       '</ol>',
+  'services.reassign.step5.body.namenode_ha': '<ol>' +
+      '<li>Login to the newly installed NameNode host <b>{2}</b></li>' +
+      '<li>Initialize the metadata by running:' +
+      "<div class='code-snippet'>sudo su -l hdfs -c 'hdfs namenode -bootstrapStandby'</div></li>" +
+      '<li>Proceed next' +
+      '</ol>',
   'services.reassign.step5.body.secondary_namenode': '<ol>' +
       '<li>Copy contents of <b>{0}</b> from source host <b>{1}</b> to the target host <b>{2}</b> same locations</li>' +
       '<li>Login to the target host <b>{2}</b> and change permissions for the SNameNode dirs by running:' +

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/37bd63fc/ambari-web/app/routes/reassign_master_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/reassign_master_routes.js b/ambari-web/app/routes/reassign_master_routes.js
index 5f56350..40659e4 100644
--- a/ambari-web/app/routes/reassign_master_routes.js
+++ b/ambari-web/app/routes/reassign_master_routes.js
@@ -133,7 +133,8 @@ module.exports = Em.Route.extend({
     },
     back: Em.Router.transitionTo('step2'),
     next: function (router) {
-      App.db.setReassignTasksStatuses(['INITIALIZE', 'INITIALIZE', 'INITIALIZE', 'INITIALIZE', 'INITIALIZE', 'INITIALIZE', 'INITIALIZE', 'INITIALIZE']);
+      App.db.setReassignTasksStatuses(undefined);
+      App.db.setReassignMasterWizardLogs(undefined);
       App.clusterStatus.setClusterStatus({
         clusterName: router.get('reassignMasterController.content.cluster.name'),
         clusterState: 'REASSIGN_MASTER_INSTALLING',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/37bd63fc/ambari-web/app/views/main/service/reassign/step5_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step5_view.js b/ambari-web/app/views/main/service/reassign/step5_view.js
index 2c84741..8b0d0fe 100644
--- a/ambari-web/app/views/main/service/reassign/step5_view.js
+++ b/ambari-web/app/views/main/service/reassign/step5_view.js
@@ -25,7 +25,8 @@ App.ReassignMasterWizardStep5View = Em.View.extend({
     var componentDir = this.get('controller.content.componentDir');
     var sourceHost = this.get('controller.content.reassignHosts.source');
     var targetHost = this.get('controller.content.reassignHosts.target');
-    return  Em.I18n.t('services.reassign.step5.body.' + this.get('controller.content.reassign.component_name').toLowerCase()).format(componentDir, sourceHost, targetHost);
+    var ha = this.get('controller.content.reassign.component_name') === 'NAMENODE' && !App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE') ? '_ha' : '';
+    return  Em.I18n.t('services.reassign.step5.body.' + this.get('controller.content.reassign.component_name').toLowerCase() + ha).format(componentDir, sourceHost, targetHost);
   }.property('controller.content.reassign.component_name', 'controller.content.componentDir', 'controller.content.masterComponentHosts', 'controller.content.reassign.host_id'),
 
   templateName: require('templates/main/service/reassign/step5')