Ver Fonte

AMBARI-4932. Moving ResourceManager/JobTracker requires shutting down entire cluster. (Mikhail Bayuk via akovalenko)

Aleksandr Kovalenko há 11 anos atrás
pai
commit
db63a74e79

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

@@ -29,6 +29,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
   multiTaskCounter: 0,
 
   hostComponents: [],
+  restartYarnMRComponents: false,
 
   loadStep: function () {
     if (this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled')) {
@@ -36,6 +37,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     } else {
       this.set('hostComponents', [this.get('content.reassign.component_name')]);
     }
+    this.set('restartYarnMRComponents', ['RESOURCEMANAGER', 'JOBTRACKER'].contains(this.get('content.reassign.component_name')));
     this.set('serviceName', [this.get('content.reassign.service_id')]);
     this._super();
   },
@@ -95,12 +97,24 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
   },
 
   stopServices: function () {
-    App.ajax.send({
-      name: 'reassign.stop_services',
-      sender: this,
-      success: 'startPolling',
-      error: 'onTaskError'
-    });
+    if(this.get('restartYarnMRComponents')) {
+      var list = App.Service.find().mapProperty("serviceName").without("HDFS").join(',');
+      var conf = {
+        name: 'reassign.stop_YMR2_services',
+        sender: this,
+        data: {servicesList: list},
+        success: 'startPolling',
+        error: 'onTaskError'
+      };
+      App.ajax.send(conf);
+    } else {
+      App.ajax.send({
+        name: 'reassign.stop_services',
+        sender: this,
+        success: 'startPolling',
+        error: 'onTaskError'
+      });
+    }
   },
 
   createHostComponents: function () {
@@ -320,12 +334,24 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
   },
 
   startServices: function () {
-    App.ajax.send({
-      name: 'reassign.start_services',
-      sender: this,
-      success: 'startPolling',
-      error: 'onTaskError'
-    });
+    if(this.get('restartYarnMRComponents')) {
+      var list = App.Service.find().mapProperty("serviceName").without("HDFS").join(',');
+      var conf = {
+        name: 'reassign.start_YMR2_services',
+        sender: this,
+        data: {servicesList: list},
+        success: 'startPolling',
+        error: 'onTaskError'
+      };
+      App.ajax.send(conf);
+    } else {
+      App.ajax.send({
+        name: 'reassign.start_services',
+        sender: this,
+        success: 'startPolling',
+        error: 'onTaskError'
+      });
+    }
   },
 
   deleteHostComponents: function () {

+ 3 - 3
ambari-web/app/messages.js

@@ -1248,7 +1248,7 @@ Em.I18n.translations = {
   'services.reassign.step1.message1': 'This wizard will walk you through moving {0}.<br/>',
   'services.reassign.step1.message2': 'The process to reassign {0} involves a combination of <b>automated steps</b> (that will be handled by the wizard) and ' +
       '<b>manual steps</b> (that you must perform in sequence as instructed by the wizard).<br/><br/>',
-  'services.reassign.step1.message3': '<br/><b>All services will be restarted as part of the wizard. You should plan a cluster maintenance window and prepare ' +
+  'services.reassign.step1.message3': '<br/><b>All required services will be restarted as part of the wizard. You should plan a cluster maintenance window and prepare ' +
     'for cluster downtime when moving {0}.</b>',
 
   'services.reassign.step2.header':'Assign Master',
@@ -1261,7 +1261,7 @@ Em.I18n.translations = {
   'services.reassign.step3.sourceHost':'Source Host:',
   'services.reassign.step3.component':'Component name:',
   'services.reassign.step4.header':'Configure Component',
-  'services.reassign.step4.task0.title':'Stop All Services',
+  'services.reassign.step4.task0.title':'Stop Required Services',
   'services.reassign.step4.task1.title':'Create {0}',
   'services.reassign.step4.task2.title':'Disable {0}',
   'services.reassign.step4.task3.title':'Reconfigure {0}',
@@ -1269,7 +1269,7 @@ Em.I18n.translations = {
   'services.reassign.step4.task5.title':'Start ZooKeeper Servers',
   'services.reassign.step4.task6.title':'Start NameNode',
   'services.reassign.step4.task7.title':'Delete disabled {0}',
-  'services.reassign.step4.task8.title':'Start All Services',
+  'services.reassign.step4.task8.title':'Start Required Services',
   'services.reassign.step4.status.success': 'Successfully moved <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host',
   'services.reassign.step4.status.success.withManualSteps': 'Proceed to the next step',
   'services.reassign.step4.status.failed': 'Failed to move <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host',

+ 38 - 0
ambari-web/app/utils/ajax.js

@@ -160,6 +160,25 @@ var urls = {
       }
     }
   },
+  'reassign.stop_YMR2_services': {
+    'real': '/clusters/{clusterName}/services?ServiceInfo/service_name.in({servicesList})',
+    'mock': '',
+    'format': function() {
+      return {
+        type: 'PUT',
+        data: JSON.stringify({
+          "RequestInfo": {
+            "context": "Stop without HDFS"
+          },
+          "Body": {
+            "ServiceInfo": {
+              "state": "INSTALLED"
+            }
+          }
+        })
+      }
+    }
+  },
   'reassign.start_services': {
     'real': '/clusters/{clusterName}/services?params/run_smoke_test=true',
     'mock': '',
@@ -179,6 +198,25 @@ var urls = {
       }
     }
   },
+  'reassign.start_YMR2_services': {
+    'real': '/clusters/{clusterName}/services/?ServiceInfo/service_name.in({servicesList})',
+    'mock': '',
+    'format': function() {
+      return {
+        type: 'PUT',
+        data: JSON.stringify({
+          "RequestInfo": {
+            "context": "Start without HDFS"
+          },
+          "Body": {
+            "ServiceInfo": {
+              "state": "STARTED"
+            }
+          }
+        })
+      }
+    }
+  },
   'reassign.maintenance_mode': {
     'real': '/clusters/{clusterName}/hosts/{hostName}/host_components/{componentName}',
     'mock': '',