Przeglądaj źródła

AMBARI-3555: Reassign Master (namenode HA): HDFS service check fails when standby namenode is stopped before wizard. (jaimin)

Jaimin Jetly 11 lat temu
rodzic
commit
139537c77d

+ 5 - 12
ambari-web/app/controllers/main/service/reassign/step4_controller.js

@@ -22,7 +22,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
 
 
   isReassign: true,
   isReassign: true,
 
 
-  commands: ['stopNameNode', 'stopServices', 'createHostComponents', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'installHostComponents', 'startZooKeeperServers', 'startNameNode', 'deleteHostComponents', 'startServices'],
+  commands: ['stopServices', 'createHostComponents', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'installHostComponents', 'startZooKeeperServers', 'startNameNode', 'deleteHostComponents', 'startServices'],
 
 
   clusterDeployState: 'REASSIGN_MASTER_INSTALLING',
   clusterDeployState: 'REASSIGN_MASTER_INSTALLING',
 
 
@@ -68,14 +68,12 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
 
 
     if (this.get('content.hasManualSteps')) {
     if (this.get('content.hasManualSteps')) {
       if (App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
       if (App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
-        this.get('tasks').splice(6, 4);
-        this.get('tasks').splice(0, 1);
+        this.get('tasks').splice(5, 4);
       } else {
       } else {
-        this.get('tasks').splice(8, 2);
+        this.get('tasks').splice(7, 2);
       }
       }
     } else {
     } else {
-      this.get('tasks').splice(6, 2);
-      this.get('tasks').splice(0, 1);
+      this.get('tasks').splice(5, 2);
     }
     }
   },
   },
 
 
@@ -93,11 +91,6 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     }
     }
   },
   },
 
 
-  stopNameNode: function () {
-    var hostName = this.get('content.reassignHosts.source');
-    this.stopComponent('NAMENODE', hostName);
-  },
-
   stopServices: function () {
   stopServices: function () {
     App.ajax.send({
     App.ajax.send({
       name: 'reassign.stop_services',
       name: 'reassign.stop_services',
@@ -339,4 +332,4 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
       }
       }
     }
     }
   }
   }
-})
+});

+ 37 - 19
ambari-web/app/messages.js

@@ -1091,16 +1091,15 @@ Em.I18n.translations = {
   'services.reassign.step3.sourceHost':'Source Host:',
   'services.reassign.step3.sourceHost':'Source Host:',
   'services.reassign.step3.component':'Component name:',
   'services.reassign.step3.component':'Component name:',
   'services.reassign.step4.header':'Install, Start and Test',
   'services.reassign.step4.header':'Install, Start and Test',
-  '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.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':'Start ZooKeeper Servers',
+  'services.reassign.step4.task6.title':'Start NameNode',
+  'services.reassign.step4.task7.title':'{0} remove',
+  'services.reassign.step4.task8.title':'Start All Services',
   'services.reassign.step4.status.success': 'Successfully reassigned {0}',
   'services.reassign.step4.status.success': 'Successfully reassigned {0}',
   'services.reassign.step4.status.success.withManualSteps': 'Proceed to the next step',
   'services.reassign.step4.status.success.withManualSteps': 'Proceed to the next step',
   'services.reassign.step4.status.failed': 'Failed to reassign {0}',
   'services.reassign.step4.status.failed': 'Failed to reassign {0}',
@@ -1108,32 +1107,51 @@ Em.I18n.translations = {
   'services.reassign.step4.retry': 'You can click on the Retry or Abort button to retry failed task or abort changes',
   'services.reassign.step4.retry': 'You can click on the Retry or Abort button to retry failed task or abort changes',
   'services.reassign.step4.abortError': 'Error in aborting changes.',
   'services.reassign.step4.abortError': 'Error in aborting changes.',
   'services.reassign.step5.header': 'Manual commands',
   'services.reassign.step5.header': 'Manual commands',
-  'services.reassign.step5.body.namenode': '<ol>' +
+  'services.reassign.step5.body.namenode':
+      '<div class="alert alert-info">' +
+      '<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>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 NameNode dirs by running:' +
       '<li>Login to the target host <b>{2}</b> and change permissions for the NameNode dirs by running:' +
       '<div class="code-snippet">chown -R hdfs:hadoop /hadoop/hdfs/namenode/</div></li>' +
       '<div class="code-snippet">chown -R hdfs:hadoop /hadoop/hdfs/namenode/</div></li>' +
       '<li>Create marker directory by running:' +
       '<li>Create marker directory by running:' +
       '<div class="code-snippet">mkdir -p /var/run/hadoop/hdfs/namenode/formatted</div></li>' +
       '<div class="code-snippet">mkdir -p /var/run/hadoop/hdfs/namenode/formatted</div></li>' +
       '<li>Proceed next' +
       '<li>Proceed next' +
-      '</ol>',
-  'services.reassign.step5.body.namenode_ha': '<ol>' +
+      '</ol>' +
+      '</div>',
+  'services.reassign.step5.body.namenode_ha':
+      '<div class="alert alert-info">' +
+      '<ol>' +
+      '<li>Login to the NameNode host <b>{4}</b>.</li>' +
+      '<li>Reset automatic failover information in ZooKeeper by running:' +
+      '<div class="code-snippet">sudo su -l {3} -c \'hdfs zkfc -formatZK\'</div></li>' +
+      '</ol>' +
+      '</div>' +
+      '<div class="alert alert-info">' +
+      '<ol start="3">' +
       '<li>Login to the newly installed NameNode host <b>{2}</b></li>' +
       '<li>Login to the newly installed NameNode host <b>{2}</b></li>' +
       '<li>Initialize the metadata by running:' +
       '<li>Initialize the metadata by running:' +
       "<div class='code-snippet'>sudo su -l {3} -c 'hdfs namenode -bootstrapStandby'</div></li>" +
       "<div class='code-snippet'>sudo su -l {3} -c 'hdfs namenode -bootstrapStandby'</div></li>" +
-      '<li>Proceed next' +
-      '</ol>',
-  'services.reassign.step5.body.secondary_namenode': '<ol>' +
+      '</ol>' +
+      '</div>' +
+      'Please proceed once you have completed the steps above.',
+  'services.reassign.step5.body.secondary_namenode':
+      '<div class="alert alert-info">' +
+      '<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>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:' +
       '<li>Login to the target host <b>{2}</b> and change permissions for the SNameNode dirs by running:' +
       '<div class="code-snippet">chown -R hdfs:hadoop /hadoop/hdfs/namesecondary/</div></li>' +
       '<div class="code-snippet">chown -R hdfs:hadoop /hadoop/hdfs/namesecondary/</div></li>' +
       '<li>Proceed next' +
       '<li>Proceed next' +
-      '</ol>',
-  'services.reassign.step5.body.jobtracker': '<ol>' +
+      '</ol>' +
+      '</div>',
+  'services.reassign.step5.body.jobtracker':
+      '<div class="alert alert-info">' +
+      '<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>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 JobTracker dirs by running:' +
       '<li>Login to the target host <b>{2}</b> and change permissions for the JobTracker dirs by running:' +
       '<div class="code-snippet">chown -R mapred:hadoop /hadoop/mapred/</div></li>' +
       '<div class="code-snippet">chown -R mapred:hadoop /hadoop/mapred/</div></li>' +
       '<li>Proceed next' +
       '<li>Proceed next' +
-      '</ol>',
+      '</ol>'+
+      '</div>',
   'services.reassign.step6.header': 'Install, Start and Test',
   'services.reassign.step6.header': 'Install, Start and Test',
   'services.reassign.step6.task0.title':'{0} remove',
   'services.reassign.step6.task0.title':'{0} remove',
   'services.reassign.step6.task1.title':'Start All Services',
   'services.reassign.step6.task1.title':'Start All Services',

+ 1 - 3
ambari-web/app/templates/main/service/reassign/step5.hbs

@@ -16,9 +16,7 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 <h2>{{t services.reassign.step5.header}}</h2>
 <h2>{{t services.reassign.step5.header}}</h2>
-<div class="alert alert-info">
-  {{{view.bodyText}}}
-</div>
+{{{view.bodyText}}}
 <div class="btn-area">
 <div class="btn-area">
   <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action next}}>{{t common.next}} &rarr;</a>
   <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action next}}>{{t common.next}} &rarr;</a>
 </div>
 </div>

+ 6 - 2
ambari-web/app/views/main/service/reassign/step5_view.js

@@ -27,7 +27,11 @@ App.ReassignMasterWizardStep5View = Em.View.extend({
     var componentDir = this.get('controller.content.componentDir');
     var componentDir = this.get('controller.content.componentDir');
     var sourceHost = this.get('controller.content.reassignHosts.source');
     var sourceHost = this.get('controller.content.reassignHosts.source');
     var targetHost = this.get('controller.content.reassignHosts.target');
     var targetHost = this.get('controller.content.reassignHosts.target');
-    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, this.get('controller.content.hdfsUser'));
+    var ha = '';
+    if (this.get('controller.content.reassign.component_name') === 'NAMENODE' && !App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
+      ha = '_ha';
+      var nnStartedHost = this.get('controller.content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName').without(this.get('controller.content.reassignHosts.target'));
+    }
+    return  Em.I18n.t('services.reassign.step5.body.' + this.get('controller.content.reassign.component_name').toLowerCase() + ha).format(componentDir, sourceHost, targetHost, this.get('controller.content.hdfsUser'),nnStartedHost);
   }.property('controller.content.reassign.component_name', 'controller.content.componentDir', 'controller.content.masterComponentHosts', 'controller.content.reassign.host_id', 'controller.content.hdfsUser')
   }.property('controller.content.reassign.component_name', 'controller.content.componentDir', 'controller.content.masterComponentHosts', 'controller.content.reassign.host_id', 'controller.content.hdfsUser')
 });
 });