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 2018/08/31 10:31:46 UTC
[ambari] branch trunk updated: AMBARI-24525 Accumulo does not
startup in Federated Cluster. (ababiichuk)
This is an automated email from the ASF dual-hosted git repository.
ababiichuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new e6f1d35 AMBARI-24525 Accumulo does not startup in Federated Cluster. (ababiichuk)
e6f1d35 is described below
commit e6f1d35bf630ca3f7f5f479978baf3430a10089d
Author: aBabiichuk <ab...@hortonworks.com>
AuthorDate: Fri Aug 31 13:31:44 2018 +0300
AMBARI-24525 Accumulo does not startup in Federated Cluster. (ababiichuk)
---
.../main/admin/federation/step3_controller.js | 55 +++++++++++++++++++---
.../main/admin/federation/step4_controller.js | 10 +++-
.../data/configs/wizards/federation_properties.js | 3 +-
.../main/admin/federation/step3_controller_test.js | 27 ++++++++---
4 files changed, 80 insertions(+), 15 deletions(-)
diff --git a/ambari-web/app/controllers/main/admin/federation/step3_controller.js b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
index 50dd211..1f9890b 100644
--- a/ambari-web/app/controllers/main/admin/federation/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
@@ -53,27 +53,29 @@ App.NameNodeFederationWizardStep3Controller = Em.Controller.extend(App.Blueprint
return App.ajax.send({
name: 'config.tags',
sender: this,
- success: 'onLoadConfigsTags',
- error: 'onTaskError'
+ success: 'onLoadConfigsTags'
});
},
onLoadConfigsTags: function (data) {
+ var servicesModel = App.Service.find();
var urlParams = '(type=hdfs-site&tag=' + data.Clusters.desired_configs['hdfs-site'].tag + ')';
- if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+ if (servicesModel.someProperty('serviceName', 'RANGER')) {
urlParams += '|(type=core-site&tag=' + data.Clusters.desired_configs['core-site'].tag + ')' +
'|(type=ranger-tagsync-site&tag=' + data.Clusters.desired_configs['ranger-tagsync-site'].tag + ')' +
'|(type=ranger-hdfs-security&tag=' + data.Clusters.desired_configs['ranger-hdfs-security'].tag + ')'
}
+ if (servicesModel.someProperty('serviceName', 'ACCUMULO')) {
+ urlParams += '|(type=accumulo-site&tag=' + data.Clusters.desired_configs['accumulo-site'].tag + ')';
+ }
App.ajax.send({
name: 'admin.get.all_configurations',
sender: this,
data: {
urlParams: urlParams
},
- success: 'onLoadConfigs',
- error: 'onTaskError'
+ success: 'onLoadConfigs'
});
},
@@ -131,6 +133,7 @@ App.NameNodeFederationWizardStep3Controller = Em.Controller.extend(App.Blueprint
},
tweakServiceConfigs: function (configs) {
+ var servicesModel = App.Service.find();
var dependencies = this.prepareDependencies();
var nameServices = App.HDFSService.find().objectAt(0).get('masterComponentGroups').mapProperty('name');
nameServices.push(dependencies.newNameservice);
@@ -147,7 +150,7 @@ App.NameNodeFederationWizardStep3Controller = Em.Controller.extend(App.Blueprint
]);
}
- if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+ if (servicesModel.someProperty('serviceName', 'RANGER')) {
var hdfsRangerConfigs = this.get('serverConfigData').items.findProperty('type', 'ranger-hdfs-security').properties;
var reponamePrefix = hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] === '{{repo_name}}' ? dependencies.clustername + '_hadoop_' : hdfsRangerConfigs['ranger.plugin.hdfs.service.name'] + '_';
var coreSiteConfigs = this.get('serverConfigData').items.findProperty('type', 'core-site').properties;
@@ -159,6 +162,46 @@ App.NameNodeFederationWizardStep3Controller = Em.Controller.extend(App.Blueprint
}, this);
}
+ if (servicesModel.someProperty('serviceName', 'ACCUMULO')) {
+ var hdfsNameSpacesModel = App.HDFSService.find().objectAt(0).get('masterComponentGroups');
+ var newNameSpace = this.get('content.nameServiceId');
+ var volumesValue = nameServices.map(function (ns) {
+ return 'hdfs://' + ns + '/apps/accumulo/data';
+ }).join();
+ var replacementsValue = nameServices.map(function (ns) {
+ var hostName;
+ if (ns === newNameSpace) {
+ var hostNames = this.get('content.masterComponentHosts').filter(function (hc) {
+ return hc.component === 'NAMENODE' && !hc.isInstalled;
+ }).mapProperty('hostName');
+ hostName = hostNames[0];
+ } else {
+ var nameSpaceObject = hdfsNameSpacesModel.findProperty('name', ns);
+ hostName = nameSpaceObject && nameSpaceObject.hosts[0];
+ }
+ return 'hdfs://' + hostName + ':8020/apps/accumulo/data hdfs://' + ns + '/apps/accumulo/data';
+ }, this).join();
+ configs.push({
+ name: 'instance.volumes',
+ displayName: 'instance.volumes',
+ isReconfigurable: false,
+ value: volumesValue,
+ recommendedValue: volumesValue,
+ category: 'ACCUMULO',
+ filename: 'accumulo-site',
+ serviceName: 'MISC'
+ }, {
+ name: 'instance.volumes.replacements',
+ displayName: 'instance.volumes.replacements',
+ isReconfigurable: false,
+ value: replacementsValue,
+ recommendedValue: replacementsValue,
+ category: 'ACCUMULO',
+ filename: 'accumulo-site',
+ serviceName: 'MISC'
+ });
+ }
+
configs.forEach(function (config) {
if (!configsToRemove.contains(config.name)) {
config.isOverridable = false;
diff --git a/ambari-web/app/controllers/main/admin/federation/step4_controller.js b/ambari-web/app/controllers/main/admin/federation/step4_controller.js
index bf340f0..605c22f 100644
--- a/ambari-web/app/controllers/main/admin/federation/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/federation/step4_controller.js
@@ -50,6 +50,7 @@ App.NameNodeFederationWizardStep4Controller = App.HighAvailabilityProgressPageCo
},
reconfigureServices: function () {
+ var servicesModel = App.Service.find();
var configs = [];
var data = this.get('content.serviceConfigProperties');
var note = Em.I18n.t('admin.nameNodeFederation.wizard,step4.save.configuration.note');
@@ -58,13 +59,20 @@ App.NameNodeFederationWizardStep4Controller = App.HighAvailabilityProgressPageCo
desired_config: this.reconfigureSites(['hdfs-site'], data, note)
}
});
- if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+ if (servicesModel.someProperty('serviceName', 'RANGER')) {
configs.push({
Clusters: {
desired_config: this.reconfigureSites(['ranger-tagsync-site'], data, note)
}
});
}
+ if (servicesModel.someProperty('serviceName', 'ACCUMULO')) {
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(['accumulo-site'], data, note)
+ }
+ });
+ }
return App.ajax.send({
name: 'common.service.multiConfigurations',
sender: this,
diff --git a/ambari-web/app/data/configs/wizards/federation_properties.js b/ambari-web/app/data/configs/wizards/federation_properties.js
index a0e632b..66b97b7 100644
--- a/ambari-web/app/data/configs/wizards/federation_properties.js
+++ b/ambari-web/app/data/configs/wizards/federation_properties.js
@@ -23,7 +23,8 @@ module.exports =
displayName: 'MISC',
configCategories: [
App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'}),
- App.ServiceConfigCategory.create({ name: 'RANGER', displayName: 'Ranger'})
+ App.ServiceConfigCategory.create({ name: 'RANGER', displayName: 'Ranger'}),
+ App.ServiceConfigCategory.create({ name: 'ACCUMULO', displayName: 'Accumulo'})
],
sites: ['core-site'],
configs: [
diff --git a/ambari-web/test/controllers/main/admin/federation/step3_controller_test.js b/ambari-web/test/controllers/main/admin/federation/step3_controller_test.js
index 3feb49f..72b05dd 100644
--- a/ambari-web/test/controllers/main/admin/federation/step3_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/federation/step3_controller_test.js
@@ -70,8 +70,7 @@ describe('App.NameNodeFederationWizardStep3Controller', function () {
expect(App.ajax.send.calledWith({
name: 'config.tags',
sender: controller,
- success: 'onLoadConfigsTags',
- error: 'onTaskError'
+ success: 'onLoadConfigsTags'
})).to.be.true;
});
});
@@ -91,6 +90,9 @@ describe('App.NameNodeFederationWizardStep3Controller', function () {
},
'ranger-hdfs-security': {
tag: 'test4'
+ },
+ 'accumulo-site': {
+ tag: 'test5'
}
}
}
@@ -98,7 +100,7 @@ describe('App.NameNodeFederationWizardStep3Controller', function () {
afterEach(function(){
App.Service.find.restore();
- })
+ });
it('should build short url params if no Ranger present', function () {
sinon.stub(App.Service, 'find').returns([]);
@@ -109,8 +111,7 @@ describe('App.NameNodeFederationWizardStep3Controller', function () {
data: {
urlParams: '(type=hdfs-site&tag=test)'
},
- success: 'onLoadConfigs',
- error: 'onTaskError'
+ success: 'onLoadConfigs'
}));
});
@@ -123,8 +124,20 @@ describe('App.NameNodeFederationWizardStep3Controller', function () {
data: {
urlParams: '(type=hdfs-site&tag=test)|(type=core-site&tag=test1)|(type=ranger-tagsync-site&tag=test2)|(type=ranger-hdfs-security&tag=test3)'
},
- success: 'onLoadConfigs',
- error: 'onTaskError'
+ success: 'onLoadConfigs'
+ }));
+ });
+
+ it('should build long url params if Accumulo is present', function () {
+ sinon.stub(App.Service, 'find').returns([{serviceName: 'ACCUMULO'}]);
+ controller.onLoadConfigsTags(data);
+ expect(App.ajax.send.calledWith({
+ name: 'admin.get.all_configurations',
+ sender: controller,
+ data: {
+ urlParams: '(type=hdfs-site&tag=test)|(type=accumulo-site&tag=test5)'
+ },
+ success: 'onLoadConfigs'
}));
});
});