|
@@ -37,6 +37,7 @@ App.WizardStep8Controller = Em.Controller.extend({
|
|
|
isBackBtnDisabled: false,
|
|
|
hasErrorOccurred: false,
|
|
|
servicesInstalled: false,
|
|
|
+ serviceConfigTags: [],
|
|
|
securityEnabled: false,
|
|
|
/**
|
|
|
* During page save time, we set the host overrides to the server.
|
|
@@ -69,6 +70,7 @@ App.WizardStep8Controller = Em.Controller.extend({
|
|
|
this.get('configs').clear();
|
|
|
this.get('globals').clear();
|
|
|
this.get('clusterInfo').clear();
|
|
|
+ this.get('serviceConfigTags').clear();
|
|
|
this.set('servicesInstalled', false);
|
|
|
},
|
|
|
|
|
@@ -1306,57 +1308,70 @@ App.WizardStep8Controller = Em.Controller.extend({
|
|
|
createConfigurations: function () {
|
|
|
var selectedServices = this.get('selectedServices');
|
|
|
if (this.get('content.controllerName') == 'installerController') {
|
|
|
- this.applyConfigurationToSite(this.createGlobalSiteObj());
|
|
|
- this.applyConfigurationToSite(this.createCoreSiteObj());
|
|
|
- this.applyConfigurationToSite(this.createHdfsSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createGlobalSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createCoreSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createHdfsSiteObj());
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
|
|
|
- this.applyConfigurationToSite(this.createMrSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createMrSiteObj());
|
|
|
if (App.supports.capacitySchedulerUi) {
|
|
|
- this.applyConfigurationToSite(this.createCapacityScheduler());
|
|
|
- this.applyConfigurationToSite(this.createMapredQueueAcls());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createCapacityScheduler());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createMapredQueueAcls());
|
|
|
}
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'MAPREDUCE2')) {
|
|
|
- this.applyConfigurationToSite(this.createMrSiteObj());
|
|
|
- this.applyConfigurationToSite(this.createMapredQueueAcls());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createMrSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createMapredQueueAcls());
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'YARN')) {
|
|
|
- this.applyConfigurationToSite(this.createYarnSiteObj());
|
|
|
- this.applyConfigurationToSite(this.createCapacityScheduler());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createYarnSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createCapacityScheduler());
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'HBASE')) {
|
|
|
- this.applyConfigurationToSite(this.createHbaseSiteObj());
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createHbaseSiteObj());
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'OOZIE')) {
|
|
|
- this.applyConfigurationToSite(this.createOozieSiteObj('OOZIE'));
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createOozieSiteObj('OOZIE'));
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'HIVE')) {
|
|
|
- this.applyConfigurationToSite(this.createHiveSiteObj('HIVE'));
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createHiveSiteObj('HIVE'));
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'WEBHCAT')) {
|
|
|
- this.applyConfigurationToSite(this.createWebHCatSiteObj('WEBHCAT'));
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createWebHCatSiteObj('WEBHCAT'));
|
|
|
}
|
|
|
if (selectedServices.someProperty('serviceName', 'HUE')) {
|
|
|
- this.applyConfigurationToSite(this.createHueSiteObj('HUE'));
|
|
|
+ this.get('serviceConfigTags').pushObject(this.createHueSiteObj('HUE'));
|
|
|
}
|
|
|
+ this.applyConfigurationsToCluster();
|
|
|
},
|
|
|
|
|
|
- applyConfigurationToSite: function (data) {
|
|
|
- console.log("Inside applyConfigurationToSite");
|
|
|
+ applyConfigurationsToCluster: function() {
|
|
|
var clusterUrl = App.apiPrefix + '/clusters/' + this.get('clusterName');
|
|
|
- var clusterData = {
|
|
|
- Clusters: {
|
|
|
- desired_configs: data
|
|
|
- }
|
|
|
+ var configData = [];
|
|
|
+ this.get('serviceConfigTags').forEach(function (_serviceConfig) {
|
|
|
+ var Clusters = {
|
|
|
+ Clusters: {
|
|
|
+ desired_config: {
|
|
|
+ type: _serviceConfig.type,
|
|
|
+ tag: _serviceConfig.tag,
|
|
|
+ properties: _serviceConfig.properties
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ configData.pushObject(JSON.stringify(Clusters));
|
|
|
+ }, this);
|
|
|
+
|
|
|
+ var data = {
|
|
|
+ configData: '[' + configData.toString() + ']'
|
|
|
};
|
|
|
- console.debug("applyConfigurationToSite(Step8): Applying to URL", clusterUrl, " Data:", clusterData);
|
|
|
+
|
|
|
+ console.debug("applyConfigurationsToCluster(Step8): Applying to URL", clusterUrl, " Data:", data.configData);
|
|
|
this.ajax({
|
|
|
type: 'PUT',
|
|
|
url: clusterUrl,
|
|
|
- data: JSON.stringify(clusterData),
|
|
|
+ data: data.configData,
|
|
|
beforeSend: function () {
|
|
|
- console.log("BeforeSend: Updating cluster config for " + clusterData.type);
|
|
|
+ console.log("BeforeSend: Updating cluster config");
|
|
|
}
|
|
|
});
|
|
|
},
|