ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-9832 JournalNode kerberos configs are missing when trying to enable HA. (ababiichuk)
Date Fri, 27 Feb 2015 16:21:01 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.0 74a36bfd3 -> e686629d5


AMBARI-9832 JournalNode kerberos configs are missing when trying to enable HA. (ababiichuk)


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

Branch: refs/heads/branch-2.0.0
Commit: e686629d5ed810112fe033b6f462c64c3edb6d81
Parents: 74a36bf
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Fri Feb 27 17:50:53 2015 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Fri Feb 27 17:51:45 2015 +0200

----------------------------------------------------------------------
 .../nameNode/step3_controller.js                |  6 +--
 .../nameNode/step5_controller.js                | 44 +++++++++++++++++++-
 .../nameNode/step3_controller_test.js           |  3 +-
 3 files changed, 48 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e686629d/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index f146567..e06893e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -83,7 +83,7 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
 
   onLoadConfigs: function (data) {
     this.set('serverConfigData',data);
-    this.removeConfigs(this.get('configsToRemove'));
+    this.removeConfigs(this.get('configsToRemove'), this.get('serverConfigData'));
     this.tweakServiceConfigs(this.get('haConfig.configs'));
     this.renderServiceConfigs(this.get('haConfig'));
     this.set('isLoaded', true);
@@ -146,10 +146,10 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
   /**
    * Find and remove config properties in <code>serverConfigData</code>
    * @param configsToRemove - map of config sites and properties to remove
+   * @param configs - configuration object
    * @returns {Object}
    */
-  removeConfigs:function (configsToRemove) {
-    var configs = this.get('serverConfigData');
+  removeConfigs:function (configsToRemove, configs) {
     Em.keys(configsToRemove).forEach(function(site){
       var siteConfigs = configs.items.findProperty('type', site);
       if (siteConfigs) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e686629d/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js
index 24aad31..6ba1c24 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step5_controller.js
@@ -85,6 +85,18 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
 
   reconfigureHDFS: function () {
     var data = this.get('content.serviceConfigProperties');
+    if (App.router.get('mainAdminKerberosController.securityEnabled')) {
+      this.reconfigureSecureHDFS();
+    } else {
+      this.updateConfigProperties(data);
+    }
+  },
+
+  /**
+   * Update service configurations
+   * @param {Object} data - config object to update
+   */
+  updateConfigProperties: function(data) {
     var siteNames = ['hdfs-site','core-site'];
     var configData = this.reconfigureSites(siteNames, data);
     App.ajax.send({
@@ -95,7 +107,7 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
       },
       error: 'onTaskError',
       success: 'installHDFSClients'
-    })
+    });
   },
 
   installHDFSClients: function () {
@@ -110,6 +122,36 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
       wizardControllerName: this.get('content.controllerName'),
       localdb: App.db.data
     });
+  },
+
+  /**
+   * Process configurations for hdfs on kerberized cluster.
+   * Secure properties will be applied to hdfs and core site after installing JournalNode.
+   * For this case we need to pull updated configurations from API, merge them with configurations
created
+   * during `Review` step and store new configurations.
+   */
+  reconfigureSecureHDFS: function() {
+    App.router.get('highAvailabilityWizardStep3Controller').loadConfigsTags.call(this);
+  },
+
+  onLoadConfigsTags: function() {
+    App.router.get('highAvailabilityWizardStep3Controller').onLoadConfigsTags.apply(this,
[].slice.call(arguments));
+  },
+
+  onLoadConfigs: function(data) {
+    var self = this;
+    var configController = App.router.get('highAvailabilityWizardStep3Controller');
+    var configData = $.extend({}, data);
+    var configItems = data.items.map(function(item) {
+      var fileName = Em.get(item, 'type');
+      var configTypeObject = self.get('content.serviceConfigProperties').items.findProperty('type',
fileName);
+      if (configTypeObject) {
+        $.extend(item.properties, configTypeObject.properties);
+      }
+      return item;
+    });
+    configItems = configController.removeConfigs(configController.get('configsToRemove'),
{items: configItems});
+    this.updateConfigProperties(configItems);
   }
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e686629d/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
b/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
index 9f6deb8..67cf643 100644
--- a/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
@@ -138,8 +138,9 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
           configsToRemove: test.toRemove,
           serverConfigData: test.configs
         });
-        controller.removeConfigs(test.toRemove);
+        var result = controller.removeConfigs(test.toRemove, controller.get('serverConfigData'));
         expect(JSON.stringify(controller.get('serverConfigData'))).to.equal(JSON.stringify(test.expected));
+        expect(JSON.stringify(result)).to.equal(JSON.stringify(test.expected));
       });
     });
   });


Mime
View raw message