You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/10/30 14:03:41 UTC

ambari git commit: AMBARI-13656 oozie service check failing after reassigning host with custom service user. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk b2abf50ea -> 8e06ea681


AMBARI-13656 oozie service check failing after reassigning host with custom service user. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 8e06ea681605f22a08015afb91b7e087b7e04e79
Parents: b2abf50
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Fri Oct 30 15:01:23 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Fri Oct 30 15:03:39 2015 +0200

----------------------------------------------------------------------
 .../main/service/reassign/step4_controller.js   | 38 ++++++++++++++------
 .../service/reassign/step4_controller_test.js   |  4 ++-
 .../main/service/reassign_controller_test.js    |  2 +-
 3 files changed, 32 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8e06ea68/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 73046c8..c6b828d 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -549,6 +549,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
       case 'OOZIE_SERVER':
         urlParams.push('(type=oozie-site&tag=' + data.Clusters.desired_configs['oozie-site'].tag + ')');
         urlParams.push('(type=core-site&tag=' + data.Clusters.desired_configs['core-site'].tag + ')');
+        urlParams.push('(type=oozie-env&tag=' + data.Clusters.desired_configs['oozie-env'].tag + ')');
         break;
       case 'HIVE_SERVER':
       case 'HIVE_METASTORE':
@@ -591,16 +592,19 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     this.setAdditionalConfigs(configs, componentName, targetHostName);
     this.setSecureConfigs(secureConfigs, configs, componentName);
 
-    if (componentName === 'NAMENODE') {
-      this.setSpecificNamenodeConfigs(configs, targetHostName);
-    }
-
-    if (componentName === 'RESOURCEMANAGER') {
-      this.setSpecificResourceMangerConfigs(configs, targetHostName);
-    }
-
-    if (componentName === 'HIVE_METASTORE' || componentName === 'HIVE_SERVER') {
-      this.setSpecificHiveConfigs(configs, targetHostName);
+    switch (componentName) {
+      case 'NAMENODE':
+        this.setSpecificNamenodeConfigs(configs, targetHostName);
+        break;
+      case 'RESOURCEMANAGER':
+        this.setSpecificResourceMangerConfigs(configs, targetHostName);
+        break;
+      case 'HIVE_METASTORE':
+      case 'HIVE_SERVER':
+        this.setSpecificHiveConfigs(configs, targetHostName);
+        break;
+      case 'OOZIE_SERVER':
+        this.setSpecificOozieConfigs(configs, targetHostName);
     }
 
     this.saveClusterStatus(secureConfigs, this.getComponentDir(configs, componentName));
@@ -748,6 +752,20 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
   },
 
   /**
+   * set specific configs which applies only to Oozie related configs
+   * @param configs
+   * @param targetHostName
+   */
+  setSpecificOozieConfigs: function (configs, targetHostName) {
+    var sourceHostName = this.get('content.reassignHosts.source'),
+      oozieServerHosts = App.HostComponent.find().filterProperty('componentName', 'OOZIE_SERVER')
+        .mapProperty('hostName').removeObject(sourceHostName).addObject(targetHostName).uniq().join(','),
+      oozieUser = configs['oozie-env']['oozie_user'];
+
+    configs['core-site']['hadoop.proxyuser.' + oozieUser + '.hosts'] = oozieServerHosts;
+  },
+
+  /**
    * set specific configs which applies only to Hive related configs
    * @param configs
    * @param targetHostName

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e06ea68/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index 99d1269..a35ca37 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -537,7 +537,8 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
         componentName: 'OOZIE_SERVER',
         result: [
           "(type=oozie-site&tag=6)",
-          "(type=core-site&tag=2)"
+          "(type=core-site&tag=2)",
+          "(type=oozie-env&tag=2)"
         ]
       },
       {
@@ -581,6 +582,7 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
           'mapred-site': {tag: 4},
           'yarn-site': {tag: 5},
           'oozie-site': {tag: 6},
+          'oozie-env': {tag: 2},
           'webhcat-site': {tag: 7},
           'yarn-env': {tag: 8},
           'accumulo-site': {tag: 9},

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e06ea68/ambari-web/test/controllers/main/service/reassign_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/reassign_controller_test.js b/ambari-web/test/controllers/main/service/reassign_controller_test.js
index 461e0df..48a6dec 100644
--- a/ambari-web/test/controllers/main/service/reassign_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign_controller_test.js
@@ -58,8 +58,8 @@ describe('App.ReassignMasterController', function () {
       it('check ' + c.componentName, function () {
         reassignMasterController.set('content.reassign', {'component_name': c.componentName});
         expect(reassignMasterController.get('totalSteps')).to.equal(c.result);
+        reassignMasterController.set('content.reassign', {service_id:null});
       });
-      reassignMasterController.set('content.reassign', {service_id:null});
     });
   });