Browse Source

AMBARI-6752. Resource Manager HA: after enabling RM HA and moving standby Resource Manager to another host, it does not start. (akovalenko)

Aleksandr Kovalenko 10 năm trước cách đây
mục cha
commit
7554662d57

+ 12 - 2
ambari-web/app/controllers/main/service/reassign/step2_controller.js

@@ -28,11 +28,21 @@ App.ReassignMasterWizardStep2Controller = App.WizardStep5Controller.extend({
     if (App.get('isHaEnabled')) {
       this.get('multipleComponents').push('NAMENODE');
     }
-    this._super();
-    if (this.get('content.reassign.component_name') === "NAMENODE" && !this.get('content.masterComponentHosts').findProperty('component', "SECONDARY_NAMENODE")) {
+    this.clearStep();
+    this.renderHostInfo();
+    this.loadStepCallback(this.loadComponents(), this);
+
+    // if moving NameNode with HA enabled
+    if (this.get('content.reassign.component_name') === "NAMENODE" && App.get('isHaEnabled')) {
       this.set('showCurrentHost', false);
       this.set('componentToRebalance', 'NAMENODE');
       this.incrementProperty('rebalanceComponentHostsCounter');
+
+    // if moving ResourceManager with HA enabled
+    } else if (this.get('content.reassign.component_name') === "RESOURCEMANAGER" && App.get('isRMHaEnabled')) {
+      this.set('showCurrentHost', false);
+      this.set('componentToRebalance', 'RESOURCEMANAGER');
+      this.incrementProperty('rebalanceComponentHostsCounter');
     } else {
       this.set('showCurrentHost', true);
       this.rebalanceSingleComponentHosts(this.get('content.reassign.component_name'));

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

@@ -413,6 +413,10 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
       this.setSpecificNamenodeConfigs(configs, targetHostName);
     }
 
+    if (componentName === 'RESOURCEMANAGER') {
+      this.setSpecificResourceMangerConfigs(configs, targetHostName);
+    }
+
     this.saveClusterStatus(secureConfigs, this.getComponentDir(configs, componentName));
     this.saveConfigsToServer(configs);
   },
@@ -461,6 +465,24 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     }
   },
 
+  /**
+   * set specific configs which applies only to ResourceManager component
+   * @param configs
+   * @param targetHostName
+   */
+  setSpecificResourceMangerConfigs: function (configs, targetHostName) {
+    var sourceHostName = this.get('content.reassignHosts.source');
+
+    if (App.get('isHadoop2Stack') && App.get('isRMHaEnabled')) {
+      if (configs['yarn-site']['yarn.resourcemanager.hostname.rm1'] === sourceHostName) {
+        configs['yarn-site']['yarn.resourcemanager.hostname.rm1'] = targetHostName;
+      } else {
+        configs['yarn-site']['yarn.resourcemanager.hostname.rm2'] = targetHostName;
+      }
+    }
+
+  },
+
   /**
    * set secure configs for component
    * @param secureConfigs

+ 2 - 2
ambari-web/app/controllers/wizard/step5_controller.js

@@ -216,7 +216,7 @@ App.WizardStep5Controller = Em.Controller.extend({
     this.clearStep();
     this.renderHostInfo();
     if (App.supports.serverRecommendValidate ) {
-      this.loadComponentRecommendationsFromServer(this.loadStepCallback);
+      this.loadComponentsRecommendationsFromServer(this.loadStepCallback);
     } else {
       this.loadComponentsRecommendationsLocally(this.loadStepCallback);
     }
@@ -305,7 +305,7 @@ App.WizardStep5Controller = Em.Controller.extend({
    * Get recommendations info from API
    * @return {undefined}
    */
-  loadComponentRecommendationsFromServer: function(callback) {
+  loadComponentsRecommendationsFromServer: function(callback) {
     var self = this;
 
     if (App.router.get('installerController.recommendations') !== undefined) {

+ 1 - 1
ambari-web/app/templates/main/admin/highAvailability.hbs

@@ -40,8 +40,8 @@
     {{/if}}
   {{/if}}
   {{#if view.supportRMHA}}
-    {{#if App.isRMHaEnabled}}
     <div class="rm-ha">
+    {{#if App.isRMHaEnabled}}
         <p class="text-success">
           {{t admin.rm_highAvailability.enabled}}
         </p>