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/02/27 17:20:40 UTC
ambari git commit: AMBARI-9832 JournalNode kerberos configs are
missing when trying to enable HA. (ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 44aae8109 -> 74b4287f9
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/74b4287f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/74b4287f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/74b4287f
Branch: refs/heads/trunk
Commit: 74b4287f9d765fb3e6ec6d4064edf7693edb2a42
Parents: 44aae81
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Fri Feb 27 17:49:48 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Fri Feb 27 17:50:53 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/74b4287f/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/74b4287f/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/74b4287f/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));
});
});
});