You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/08/29 21:38:03 UTC
git commit: AMBARI-7088. Config History: modify API calls for saving
config so that one SCV is created rather than multiple. (jaimin)
Repository: ambari
Updated Branches:
refs/heads/trunk 45ecfc8dd -> 72fe79c87
AMBARI-7088. Config History: modify API calls for saving config so that one SCV is created rather than multiple. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/72fe79c8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/72fe79c8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/72fe79c8
Branch: refs/heads/trunk
Commit: 72fe79c87da9260f398e787b0ecb1d2e0d7f2685
Parents: 45ecfc8
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Aug 29 12:37:20 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Aug 29 12:37:42 2014 -0700
----------------------------------------------------------------------
ambari-web/app/config.js | 2 +-
.../nameNode/step5_controller.js | 26 ++-----
.../nameNode/step9_controller.js | 8 +--
.../highAvailability/progress_controller.js | 23 ++++++
.../resourceManager/step4_controller.js | 11 ++-
.../security/security_progress_controller.js | 45 +++++++-----
ambari-web/app/controllers/main/host/details.js | 22 +++---
.../controllers/main/service/info/configs.js | 23 +-----
.../main/service/reassign/step4_controller.js | 73 +++++++++++++-------
.../app/controllers/wizard/step8_controller.js | 67 +++++++-----------
ambari-web/app/messages.js | 4 ++
ambari-web/app/models/stack_service.js | 10 ++-
ambari-web/app/utils/ajax/ajax.js | 67 ++++++++----------
13 files changed, 192 insertions(+), 189 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index b734111..c7bb9d0 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -78,7 +78,7 @@ App.supports = {
views: true,
flume: true,
databaseConnection: true,
- configHistory: false,
+ configHistory: true,
serverRecommendValidate: true,
downloadClientConfigs: true,
abortRequests: true
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/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 f5e93a5..24aad31 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,29 +85,17 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
reconfigureHDFS: function () {
var data = this.get('content.serviceConfigProperties');
- var hdfsSiteProperties = data.items.findProperty('type', 'hdfs-site').properties;
- var coreSiteProperties = data.items.findProperty('type', 'core-site').properties;
- var self = this;
+ var siteNames = ['hdfs-site','core-site'];
+ var configData = this.reconfigureSites(siteNames, data);
App.ajax.send({
- name: 'admin.high_availability.save_configs',
+ name: 'common.service.configurations',
sender: this,
data: {
- siteName: 'hdfs-site',
- properties: hdfsSiteProperties
+ desired_config: configData
},
- error: 'onTaskError'
- }).done(function() {
- App.ajax.send({
- name: 'admin.high_availability.save_configs',
- sender: self,
- data: {
- siteName: 'core-site',
- properties: coreSiteProperties
- },
- error: 'onTaskError',
- success: 'installHDFSClients'
- });
- });
+ error: 'onTaskError',
+ success: 'installHDFSClients'
+ })
},
installHDFSClients: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
index 26ca0c7..d4d5328 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
@@ -61,14 +61,12 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
reconfigureHBase: function () {
var data = this.get('content.serviceConfigProperties');
- var hbaseSiteProperties = data.items.findProperty('type', 'hbase-site').properties;
-
+ var configData = this.reconfigureSites(['hbase-site'],data);
App.ajax.send({
- name: 'admin.high_availability.save_configs',
+ name: 'common.service.configurations',
sender: this,
data: {
- siteName: 'hbase-site',
- properties: hbaseSiteProperties
+ desired_config: configData
},
success: 'saveConfigTag',
error: 'onTaskError'
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
index 3f3fd60..67ec07d 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -407,6 +407,29 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
this.removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
App.router.send('next');
}
+ },
+ /**
+ *
+ * @param siteNames Array
+ */
+ reconfigureSites: function(siteNames,data) {
+ var tagName = 'version' + (new Date).getTime();
+ var componentName;
+ switch (this.get('content.controllerName')) {
+ case 'rMHighAvailabilityWizardController':
+ componentName = 'RESOURCEMANAGER';
+ break;
+ default:
+ componentName = 'NAMENODE';
+ }
+ return siteNames.map(function(_siteName){
+ return {
+ type: _siteName,
+ tag: tagName,
+ properties: data.items.findProperty('type', _siteName).properties,
+ service_config_version_note: Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role(componentName))
+ }
+ });
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
index 335f8e0..1caa3e0 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
@@ -80,18 +80,17 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo
onLoadConfigs: function (data) {
var propertiesToAdd = this.get('content.configs');
- var configs = data.items[0].properties;
-
propertiesToAdd.forEach(function (property) {
- configs[property.name] = property.value;
+ data.items[0].properties[property.name] = property.value;
});
+ var configData = this.reconfigureSites(['yarn-site'],data);
+
App.ajax.send({
- name: 'reassign.save_configs',
+ name: 'common.service.configurations',
sender: this,
data: {
- siteName: 'yarn-site',
- properties: configs
+ desired_config: configData
},
success: 'onSaveConfigs',
error: 'onTaskError'
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
index 1d020fb..4af298a 100644
--- a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
@@ -274,28 +274,41 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
* form query data and apply security configurations to server
*/
applyConfigurationsToCluster: function () {
- var configData = [];
- this.get('serviceConfigTags').forEach(function (_serviceConfig) {
- var Clusters = {
- Clusters: {
- desired_config: {
- type: _serviceConfig.siteName,
- tag: _serviceConfig.newTagName,
- properties: _serviceConfig.configs
- }
- }
+ var configData = this.get('serviceConfigTags').map(function (_serviceConfig) {
+ return {
+ type: _serviceConfig.siteName,
+ tag: _serviceConfig.newTagName,
+ properties: _serviceConfig.configs,
+ service_config_version_note: Em.I18n.t('admin.security.step4.save.configuration.note')
};
- configData.pushObject(JSON.stringify(Clusters));
}, this);
- var data = {
- configData: '[' + configData.toString() + ']'
- };
+ var selectedServices = this.get('secureServices');
+ var allConfigData = [];
+ selectedServices.forEach(function (service) {
+ var stackService = App.StackService.find(service.serviceName);
+ if (stackService) {
+ var serviceConfigData = [];
+ Object.keys(stackService.get('configTypesRendered')).forEach(function (type) {
+ var serviceConfigTag = configData.findProperty('type', type);
+ if (serviceConfigTag) {
+ serviceConfigData.pushObject(serviceConfigTag);
+ }
+ }, this);
+ allConfigData.pushObject(JSON.stringify({
+ Clusters: {
+ desired_config: serviceConfigData
+ }
+ }));
+ }
+ }, this);
App.ajax.send({
- name: 'admin.security.apply_configurations',
+ name: 'common.across.services.configurations',
sender: this,
- data: data,
+ data: {
+ data: '[' + allConfigData.toString() + ']'
+ },
success: 'applyConfigurationToClusterSuccessCallback',
error: 'applyConfigurationToClusterErrorCallback'
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index d7359dc..1a334ba 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -143,8 +143,8 @@ App.MainHostDetailsController = Em.Controller.extend({
* @method stopComponentSuccessCallback
*/
sendComponentCommandSuccessCallback: function (data, opt, params) {
- var running = (params.HostRoles.state === App.HostComponentStatus.stopped) ? App.HostComponentStatus.stopping : App.HostComponentStatus.starting;
- console.log('Send request for '+running+' successfully');
+ var running = (params.HostRoles.state === App.HostComponentStatus.stopped) ? App.HostComponentStatus.stopping : App.HostComponentStatus.starting;
+ console.log('Send request for ' + running + ' successfully');
params.component.set('workStatus', running);
if (App.get('testMode')) {
this.mimicWorkStatusChange(params.component, running, params.HostRoles.state);
@@ -170,7 +170,7 @@ App.MainHostDetailsController = Em.Controller.extend({
* @param transitionalState
* @param finalState
*/
- mimicWorkStatusChange: function(entity, transitionalState, finalState) {
+ mimicWorkStatusChange: function (entity, transitionalState, finalState) {
if (Em.isArray(entity)) {
entity.forEach(function (item) {
item.set('workStatus', transitionalState);
@@ -650,12 +650,14 @@ App.MainHostDetailsController = Em.Controller.extend({
sender: this,
data: {
siteName: site,
- properties: configs[site]
+ properties: configs[site],
+ service_config_version_note: Em.I18n.t('hosts.host.zooKeeper.configs.save.note')
}
});
}
},
/**
+ *
* Set new values for some configs (based on available ZooKeeper Servers)
* @param configs {object}
* @param zksWithPort {string}
@@ -663,7 +665,7 @@ App.MainHostDetailsController = Em.Controller.extend({
* @return {Boolean}
*/
setZKConfigs: function (configs, zksWithPort, zks) {
- if(typeof configs !== 'object' || !Array.isArray(zks)) return false;
+ if (typeof configs !== 'object' || !Array.isArray(zks)) return false;
if (App.get('isHaEnabled')) {
configs['core-site']['ha.zookeeper.quorum'] = zksWithPort;
}
@@ -883,7 +885,7 @@ App.MainHostDetailsController = Em.Controller.extend({
* @param {string} hostNames - list of host when run from bulk operations or current host
*/
- warnBeforeDecommission: function(hostNames) {
+ warnBeforeDecommission: function (hostNames) {
if (this.get('content.hostComponents').findProperty('componentName', 'HBASE_REGIONSERVER').get('passiveState') == "OFF") {
this.showHbaseActiveWarning();
} else {
@@ -896,10 +898,10 @@ App.MainHostDetailsController = Em.Controller.extend({
* @method showHbaseActiveWarning
* @return {App.ModalPopup}
*/
- showHbaseActiveWarning: function() {
+ showHbaseActiveWarning: function () {
return App.ModalPopup.show({
header: Em.I18n.t('common.warning'),
- message: function(){
+ message: function () {
return Em.I18n.t('hostPopup.reccomendation.beforeDecommission').format(App.format.components["HBASE_REGIONSERVER"]);
}.property(),
bodyClass: Ember.View.extend({
@@ -1553,10 +1555,10 @@ App.MainHostDetailsController = Em.Controller.extend({
}
},
- toggleMaintenanceMode: function(event) {
+ toggleMaintenanceMode: function (event) {
var self = this;
var state = event.context.get('passiveState') === "ON" ? "OFF" : "ON";
- var message = Em.I18n.t('passiveState.turn' + state.toCapital() +'For').format(event.context.get('displayName'));
+ var message = Em.I18n.t('passiveState.turn' + state.toCapital() + 'For').format(event.context.get('displayName'));
return App.showConfirmationPopup(function () {
self.updateComponentPassiveState(event.context, state, message);
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 5a1bace..992fbc5 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1884,24 +1884,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
},
/**
- * prepare configuration data to save
- * @param sites
- * @return {Array}
- */
- prepareConfigurationDataToSave: function (sites) {
- var data = [];
-
- sites.forEach(function (configs) {
- data.push({
- Clusters: {
- desired_config: configs
- }
- })
- });
- return data;
- },
-
- /**
* Saves configuration of set of sites. The provided data
* contains the site name and tag to be used.
* @param {Object} sites
@@ -1909,11 +1891,10 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
*/
doPUTClusterConfigurationSites: function (sites) {
App.ajax.send({
- name: 'config.cluster_configuration.put',
+ name: 'common.service.configurations',
sender: this,
data: {
- data: JSON.stringify(this.prepareConfigurationDataToSave(sites)),
- cluster: App.router.getClusterName()
+ desired_config: sites
},
success: 'doPUTClusterConfigurationSiteSuccessCallback',
error: 'doPUTClusterConfigurationSiteErrorCallback'
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/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 35c6cdc..6d91432 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -278,7 +278,9 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
};
var unrelatedServices = this.get('unrelatedServicesMap')[this.get('content.reassign.component_name')];
if (unrelatedServices) {
- var list = App.Service.find().mapProperty("serviceName").filter(function(s){return !unrelatedServices.contains(s)}).join(',');
+ var list = App.Service.find().mapProperty("serviceName").filter(function (s) {
+ return !unrelatedServices.contains(s)
+ }).join(',');
data.context = "Stop required services";
data.urlParams = "ServiceInfo/service_name.in(" + list + ")";
} else {
@@ -398,17 +400,11 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
});
},
- configsSitesCount: null,
-
- configsSitesNumber: null,
-
onLoadConfigs: function (data) {
var componentName = this.get('content.reassign.component_name');
var targetHostName = this.get('content.reassignHosts.target');
var configs = {};
var secureConfigs = [];
- this.set('configsSitesNumber', data.items.length);
- this.set('configsSitesCount', 0);
data.items.forEach(function (item) {
configs[item.type] = item.properties;
@@ -434,18 +430,46 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
* @param configs
*/
saveConfigsToServer: function (configs) {
- for (var site in configs) {
- App.ajax.send({
- name: 'reassign.save_configs',
- sender: this,
- data: {
- siteName: site,
- properties: configs[site]
- },
- success: 'onSaveConfigs',
- error: 'onTaskError'
- });
- }
+ var componentName = this.get('content.reassign.component_name');
+ var tagName = 'version' + (new Date).getTime();
+ var configData = Object.keys(configs).map(function (_siteName) {
+ return {
+ type: _siteName,
+ tag: tagName,
+ properties: configs[_siteName],
+ service_config_version_note: Em.I18n.t('services.reassign.step4.save.configuration.note').format(App.format.role(componentName))
+ }
+ });
+
+ var installedServices = App.Service.find();
+ var allConfigData = [];
+ installedServices.forEach(function (service) {
+ var stackService = App.StackService.find().findProperty('serviceName', service.get('serviceName'));
+ if (stackService) {
+ var serviceConfigData = [];
+ Object.keys(stackService.get('configTypesRendered')).forEach(function (type) {
+ var serviceConfigTag = configData.findProperty('type', type);
+ if (serviceConfigTag) {
+ serviceConfigData.pushObject(serviceConfigTag);
+ }
+ }, this);
+ allConfigData.pushObject(JSON.stringify({
+ Clusters: {
+ desired_config: serviceConfigData
+ }
+ }));
+ }
+ }, this);
+
+ App.ajax.send({
+ name: 'common.across.services.configurations',
+ sender: this,
+ data: {
+ data: '[' + allConfigData.toString() + ']'
+ },
+ success: 'onSaveConfigs',
+ error: 'onTaskError'
+ });
},
/**
@@ -551,10 +575,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
},
onSaveConfigs: function () {
- this.set('configsSitesCount', this.get('configsSitesCount') + 1);
- if (this.get('configsSitesCount') === this.get('configsSitesNumber')) {
- this.onTaskCompleted();
- }
+ this.onTaskCompleted();
},
startZooKeeperServers: function () {
@@ -570,7 +591,9 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
startServices: function () {
var unrelatedServices = this.get('unrelatedServicesMap')[this.get('content.reassign.component_name')];
if (unrelatedServices) {
- var list = App.Service.find().mapProperty("serviceName").filter(function(s){return !unrelatedServices.contains(s)}).join(',');
+ var list = App.Service.find().mapProperty("serviceName").filter(function (s) {
+ return !unrelatedServices.contains(s)
+ }).join(',');
var conf = {
name: 'common.services.update',
sender: this,
@@ -579,7 +602,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
"ServiceInfo": {
"state": "STARTED"
},
- urlParams: "ServiceInfo/service_name.in("+list+")"},
+ urlParams: "ServiceInfo/service_name.in(" + list + ")"},
success: 'startPolling',
error: 'onTaskError'
};
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 2846e8c..b008f92 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -707,7 +707,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
var hostsCount = masterComponents.filterProperty('component', componentName).length;
return stringUtils.pluralize(hostsCount,
masterComponents.findProperty('component', componentName).hostName,
- hostsCount + ' ' + Em.I18n.t('installer.step8.hosts'));
+ hostsCount + ' ' + Em.I18n.t('installer.step8.hosts'));
},
/**
@@ -850,24 +850,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
}, this);
if (!configsMap.length) return;
- var configData = configsMap.map(function (siteConfigObject) {
- return JSON.stringify({
- Clusters: {
- desired_config: {
- type: siteConfigObject.type,
- tag: siteConfigObject.tag,
- properties: siteConfigObject.properties,
- properties_attributes: siteConfigObject.properties_attributes
- }
- }
- });
- }, this).toString();
- this.addRequestToAjaxQueue({
- name: 'wizard.step8.apply_configuration_to_cluster',
- data: {
- data: '[' + configData + ']'
- }
- });
+ this.applyConfigurationsToCluster(configsMap);
},
/**
* Prepare <code>ajaxQueue</code> and start to execute it
@@ -991,7 +974,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
this.updateConfigurations(this.get('wizardController').getDBProperty('fileNamesToUpdate'));
}
this.createConfigurations();
- this.applyConfigurationsToCluster();
+ this.applyConfigurationsToCluster(this.get('serviceConfigTags'));
}
this.createComponents();
this.registerHostsToCluster();
@@ -1462,26 +1445,31 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
* Send <code>serviceConfigTags</code> to server
* Queued request
* One request for each service config tag
+ * @param serviceConfigTags
* @method applyConfigurationsToCluster
*/
- applyConfigurationsToCluster: function () {
- var configData = this.get('serviceConfigTags').map(function (_serviceConfig) {
- return JSON.stringify({
+ applyConfigurationsToCluster: function (serviceConfigTags) {
+ var selectedServices = this.get('selectedServices');
+ var allConfigData = [];
+ selectedServices.forEach(function (service) {
+ var serviceConfigData = [];
+ Object.keys(service.get('configTypesRendered')).forEach(function (type) {
+ var serviceConfigTag = serviceConfigTags.findProperty('type', type);
+ if (serviceConfigTag) {
+ serviceConfigData.pushObject(serviceConfigTag);
+ }
+ }, this);
+ allConfigData.pushObject(JSON.stringify({
Clusters: {
- desired_config: {
- type: _serviceConfig.type,
- tag: _serviceConfig.tag,
- properties: _serviceConfig.properties,
- properties_attributes: _serviceConfig.properties_attributes,
- service_config_version_note: _serviceConfig.service_config_version_note
- }
+ desired_config: serviceConfigData
}
- });
- }, this).toString();
+ }));
+ }, this);
+
this.addRequestToAjaxQueue({
- name: 'wizard.step8.apply_configuration_to_cluster',
+ name: 'common.across.services.configurations',
data: {
- data: '[' + configData + ']'
+ data: '[' + allConfigData.toString() + ']'
}
});
},
@@ -1603,19 +1591,12 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
hcatUser = this.get('configs').someProperty('name', 'hcat_user') ? this.get('configs').findProperty('name', 'hcat_user').value : null,
isGLUSTERFSSelected = installedAndSelectedServices.someProperty('serviceName', 'GLUSTERFS');
- // screen out the GLUSTERFS-specific core-site.xml entries when they are not needed
- if (!isGLUSTERFSSelected) {
- coreSiteObj = coreSiteObj.filter(function (_config) {
- return !_config.name.contains("fs.glusterfs");
- });
- }
-
coreSiteObj.forEach(function (_coreSiteObj) {
// exclude some configs if service wasn't selected
if (
(isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) &&
- (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) &&
- (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
+ (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) &&
+ (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
coreSiteProperties[_coreSiteObj.name] = App.config.escapeXMLCharacters(_coreSiteObj.value);
}
if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 6a93c0a..b430d8d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -931,6 +931,7 @@ Em.I18n.translations = {
'admin.highAvailability.wizard.step3.toBeDeleted': 'TO BE DELETED',
'admin.highAvailability.wizard.step4.ckNotCreated':'Checkpoint not created yet',
'admin.highAvailability.wizard.step4.ckCreated':'Checkpoint created',
+ 'admin.highAvailability.step4.save.configuration.note':'This configuration is created by Enable {0} HA wizard',
'admin.highAvailability.wizard.step6.jsNoInit':'JournalNodes not initialized yet',
'admin.highAvailability.wizard.step6.jsInit':'JournalNodes initialized',
'admin.highAvailability.wizard.step8.metaNoInit':'Metadata not initialized yet',
@@ -1066,6 +1067,7 @@ Em.I18n.translations = {
'admin.security.step4.body.header': 'Applying kerberos security to the cluster',
'admin.security.step4.body.success.header' : 'Kerberos-based security has been enabled on your cluster. Please wait while services are started in secure mode.',
'admin.security.step4.body.failure.header' : 'Failed to enable Kerberos-based security on your cluster. Your cluster will keep running in non-secure mode.',
+ 'admin.security.step4.save.configuration.note':'This configuration is created by Enable/Disable security wizard',
'admin.security.apply.configuration.error' : 'Failed to apply secure configurations to the cluster. Please navigate to "Configure Services" step and make sure all services are configured with appropriate values.',
'admin.security.disable.body.header' : 'Disabling kerberos security on the cluster',
'admin.security.disable.body.success.header': 'Kerberos-based security has been disabled on your cluster. Please wait while services are started in non-secure mode.',
@@ -1475,6 +1477,7 @@ Em.I18n.translations = {
'services.reassign.step4.task1.title':'Create {0}',
'services.reassign.step4.task2.title':'Disable {0}',
'services.reassign.step4.task3.title':'Reconfigure {0}',
+ 'services.reassign.step4.save.configuration.note':'This configuration is created by Move {0} wizard',
'services.reassign.step4.task4.title':'Install {0}',
'services.reassign.step4.task5.title':'Start ZooKeeper Servers',
'services.reassign.step4.task6.title':'Start NameNode',
@@ -1701,6 +1704,7 @@ Em.I18n.translations = {
'hosts.host.addComponent.msg':'Are you sure you want to add {0}?',
'hosts.host.addComponent.addZooKeeper':'Adding ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li></ul>',
'hosts.host.addComponent.deleteHostWithZooKeeper':'Deleting host with ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li></ul>',
+ 'hosts.host.zooKeeper.configs.save.note': 'This configuration is created by ambari while installing/deleting zookeeper component on a host',
'hosts.host.addComponent.note':'<b>Important:</b> After this <i>{0}</i> is installed, go to <i>Services -> Nagios</i> to restart the Nagios service. This is required for the alerts and notifications to work properly.',
'hosts.host.addComponent.securityNote':'You are running your cluster in secure mode. You must set up the keytab for {0} on {1} before you proceed. Otherwise, the component will not be able to start properly.',
'hosts.host.addComponent.popup.confirm':'Confirm Add',
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 80dfc4f..ec7bcd4 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -65,13 +65,11 @@ App.StackService = DS.Model.extend({
configTypesRendered: function () {
var configTypes = this.get('configTypes');
- // if (this.get('serviceName') == 'HDFS' || this.get('serviceName') == 'GLUSTERFS') return configTypes;
- if (this.get('serviceName') == 'HDFS') return configTypes;
- else {
- var renderedConfigTypes = $.extend(true, {}, configTypes);
- delete renderedConfigTypes['core-site'];
- return renderedConfigTypes
+ var renderedConfigTypes = $.extend(true, {}, configTypes);
+ if (this.get('serviceName') == 'FALCON') {
+ delete renderedConfigTypes['oozie-site'];
}
+ return renderedConfigTypes
}.property('serviceName', 'configTypes'),
displayNameOnSelectServicePage: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/72fe79c8/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index fa7dc72..25a8cd2 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -143,6 +143,33 @@ var urls = {
}
},
+ 'common.service.configurations': {
+ 'real':'/clusters/{clusterName}',
+ 'mock':'',
+ 'format': function (data) {
+ return {
+ type: 'PUT',
+ data: JSON.stringify({
+ Clusters: {
+ desired_config: data.desired_config
+ }
+ })
+ }
+ }
+ },
+
+ 'common.across.services.configurations': {
+ 'real':'/clusters/{clusterName}',
+ 'mock':'',
+ 'format': function(data) {
+ return {
+ type: 'PUT',
+ dataType: 'text',
+ data: data.data
+ }
+ }
+ },
+
'service.flume.agent.command': {
'real': '/clusters/{clusterName}/hosts/{host}/host_components/FLUME_HANDLER',
'mock': '',
@@ -398,26 +425,15 @@ var urls = {
desired_config: {
"type": data.siteName,
"tag": 'version' + (new Date).getTime(),
- "properties": data.properties
+ "properties": data.properties,
+ "service_config_version_note": data.service_config_version_note
+
}
}
})
}
}
},
-
- 'config.cluster_configuration.put': {
- 'real': '/clusters/{cluster}',
- 'mock': '',
- 'format': function(data) {
- return {
- type: 'PUT',
- dataType: 'text',
- data: data.data
- }
- }
- },
-
'config.advanced': {
'real': '{stackVersionUrl}/services/{serviceName}/configurations?fields=*',
'mock': '/data/wizard/stack/hdp/version{stackVersion}/{serviceName}.json'
@@ -1005,17 +1021,6 @@ var urls = {
};
}
},
- 'admin.security.apply_configurations': {
- 'real': '/clusters/{clusterName}',
- 'mock': '',
- 'format': function (data) {
- return {
- type: 'PUT',
- timeout: 10000,
- data: data.configData
- };
- }
- },
'admin.security.add.cluster_configs': {
'real': '/clusters/{clusterName}' + '?fields=Clusters/desired_configs',
'mock': '',
@@ -1159,18 +1164,6 @@ var urls = {
}
},
- 'wizard.step8.apply_configuration_to_cluster': {
- 'real':'/clusters/{cluster}',
- 'mock':'',
- 'format': function(data) {
- return {
- type: 'PUT',
- dataType: 'text',
- data: data.data
- }
- }
- },
-
'wizard.step8.apply_configuration_groups': {
'real':'/clusters/{cluster}/config_groups',
'mock':'',