Переглянути джерело

AMBARI-15611. Moving masters causes services to be shut down unnecessarily, causing downtime that's avoidable (rzang)

Richard Zang 9 роки тому
батько
коміт
0808f2cb5b

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

@@ -75,18 +75,18 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
   componentsWithoutReconfiguration: ['METRICS_COLLECTOR'],
 
   /**
-   * Map with lists of unrelated services.
+   * Map with lists of related services.
    * Used to define list of services to stop/start.
    */
-  unrelatedServicesMap: {
-    'JOBTRACKER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
-    'RESOURCEMANAGER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
-    'APP_TIMELINE_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
-    'OOZIE_SERVER': ['ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM', 'HIVE'],
-    'WEBHCAT_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
-    'HIVE_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
-    'HIVE_METASTORE': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
-    'MYSQL_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM']
+  relatedServicesMap: {
+    'JOBTRACKER': ['PIG', 'OOZIE'],
+    'RESOURCEMANAGER': ['YARN', 'MAPREDUCE2', 'TEZ', 'PIG', 'OOZIE', 'SLIDER', 'SPARK'],
+    'APP_TIMELINE_SERVER': ['YARN', 'MAPREDUCE2', 'TEZ', 'OOZIE', 'SLIDER', 'SPARK'],
+    'HIVE_SERVER': ['HIVE', 'FALCON', 'ATLAS', 'OOZIE'],
+    'HIVE_METASTORE': ['HIVE', 'PIG', 'FALCON', 'ATLAS', 'OOZIE'],
+    'WEBHCAT_SERVER': ['HIVE'],
+    'OOZIE_SERVER': ['OOZIE', 'FALCON', 'KNOX'],
+    'MYSQL_SERVER': ['HIVE', 'OOZIE', 'RANGER', 'RANGER_KMS']
   },
 
   dbPropertyMap: {
@@ -470,7 +470,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
    * make server call to stop services
    */
   stopRequiredServices: function () {
-    this.stopServices(this.get('unrelatedServicesMap')[this.get('content.reassign.component_name')]);
+    this.stopServices(this.get('relatedServicesMap')[this.get('content.reassign.component_name')], true);
   },
 
   createHostComponents: function () {
@@ -914,9 +914,9 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
    * make server call to start services
    */
   startRequiredServices: function () {
-    var unrelatedServices = this.get('unrelatedServicesMap')[this.get('content.reassign.component_name')];
-    if (unrelatedServices) {
-      this.startServices(false, unrelatedServices);
+    var relatedServices = this.get('relatedServicesMap')[this.get('content.reassign.component_name')];
+    if (relatedServices) {
+      this.startServices(false, relatedServices, true);
     } else {
       this.startServices(true);
     }

+ 2 - 2
ambari-web/test/controllers/main/service/reassign/step4_controller_test.js

@@ -320,7 +320,7 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
     it('stopServices is called with valid list of services', function() {
       controller.set('content.reassign.component_name', 'JOBTRACKER');
       controller.stopRequiredServices();
-      expect(controller.stopServices.calledWith(['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'])).to.be.true;
+      expect(controller.stopServices.calledWith(['PIG', 'OOZIE'], true)).to.be.true;
     });
   });
 
@@ -1215,7 +1215,7 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
     it("component has related services", function() {
       controller.set('content.reassign.component_name', 'JOBTRACKER');
       controller.startRequiredServices();
-      expect(controller.startServices.calledWith(false, ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'])).to.be.true;
+      expect(controller.startServices.calledWith(false, ['PIG', 'OOZIE'], true)).to.be.true;
     });
     it("component does not have related services", function() {
       controller.set('content.reassign.component_name', 'C1');