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 2016/10/31 20:54:02 UTC
ambari git commit: AMBARI-18706. Ranger Audit Handler not working as
expected as NN HA wizard does not set a few properties correctly. (Vivek
Ratnavel Subramanian via Jaimin)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 da0d6051e -> 06c07edaf
AMBARI-18706. Ranger Audit Handler not working as expected as NN HA wizard does not set a few properties correctly. (Vivek Ratnavel Subramanian via Jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/06c07eda
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/06c07eda
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/06c07eda
Branch: refs/heads/branch-2.5
Commit: 06c07edaf7f216a1a9344889ac61e0277a9657b4
Parents: da0d605
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Mon Oct 31 13:28:53 2016 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Mon Oct 31 13:28:53 2016 -0700
----------------------------------------------------------------------
.../nameNode/step3_controller.js | 105 ++++++++++
.../nameNode/step5_controller.js | 14 ++
.../nameNode/step7_controller.js | 17 +-
.../nameNode/step9_controller.js | 166 +++++++++++++++-
.../nameNode/wizard_controller.js | 8 +-
ambari-web/app/data/HDP2/ha_properties.js | 195 ++++++++++++++++++-
ambari-web/app/messages.js | 18 +-
.../app/routes/high_availability_routes.js | 3 +
ambari-web/app/utils/ajax/ajax.js | 11 ++
.../utils/configs/nn_ha_config_initializer.js | 30 ++-
.../nameNode/step3_controller_test.js | 24 ++-
11 files changed, 572 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/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 1dcf2b7..1e80e72 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
@@ -74,6 +74,7 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
var hdfsSiteTag = data.Clusters.desired_configs['hdfs-site'].tag;
var coreSiteTag = data.Clusters.desired_configs['core-site'].tag;
var zkSiteTag = data.Clusters.desired_configs['zoo.cfg'].tag;
+
urlParams.push('(type=hdfs-site&tag=' + hdfsSiteTag + ')');
urlParams.push('(type=core-site&tag=' + coreSiteTag + ')');
urlParams.push('(type=zoo.cfg&tag=' + zkSiteTag + ')');
@@ -104,6 +105,110 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
urlParams.push('(type=hdfs-client&tag=' + hdfsClientTag + ')');
this.set("hdfsClientTag", {name : "hdfsClientTag", value : hdfsClientTag});
}
+ if(App.Service.find().someProperty('serviceName', 'RANGER')) {
+ var rangerEnvTag = data.Clusters.desired_configs['ranger-env'].tag;
+ urlParams.push('(type=ranger-env&tag=' + rangerEnvTag + ')');
+ this.set("rangerEnvTag", {name : "rangerEnvTag", value : rangerEnvTag});
+ if('ranger-hdfs-plugin-properties' in data.Clusters.desired_configs) {
+ var rangerHdfsPluginPropertiesTag = data.Clusters.desired_configs['ranger-hdfs-plugin-properties'].tag;
+ urlParams.push('(type=ranger-hdfs-plugin-properties&tag=' + rangerHdfsPluginPropertiesTag + ')');
+ this.set("rangerHdfsPluginPropertiesTag", {
+ name: "rangerHdfsPluginPropertiesTag",
+ value: rangerHdfsPluginPropertiesTag
+ });
+ }
+ if('ranger-hdfs-audit' in data.Clusters.desired_configs) {
+ var rangerHdfsAuditTag = data.Clusters.desired_configs['ranger-hdfs-audit'].tag;
+ urlParams.push('(type=ranger-hdfs-audit&tag=' + rangerHdfsAuditTag + ')');
+ this.set("rangerHdfsAuditTag", {name: "rangerHdfsAuditTag", value: rangerHdfsAuditTag});
+ }
+ if('ranger-yarn-audit' in data.Clusters.desired_configs) {
+ var yarnAuditTag = data.Clusters.desired_configs['ranger-yarn-audit'].tag;
+ urlParams.push('(type=ranger-yarn-audit&tag=' + yarnAuditTag + ')');
+ this.set("yarnAuditTag", {name: "yarnAuditTag", value: yarnAuditTag});
+ }
+ if (App.Service.find().someProperty('serviceName', 'HBASE')) {
+ if('ranger-hbase-audit' in data.Clusters.desired_configs) {
+ var rangerHbaseAuditTag = data.Clusters.desired_configs['ranger-hbase-audit'].tag;
+ urlParams.push('(type=ranger-hbase-audit&tag=' + rangerHbaseAuditTag + ')');
+ this.set("rangerHbaseAuditTag", {name: "rangerHbaseAuditTag", value: rangerHbaseAuditTag});
+ }
+ if('ranger-hbase-plugin-properties' in data.Clusters.desired_configs) {
+ var rangerHbasePluginPropertiesTag = data.Clusters.desired_configs['ranger-hbase-plugin-properties'].tag;
+ urlParams.push('(type=ranger-hbase-plugin-properties&tag=' + rangerHbasePluginPropertiesTag + ')');
+ this.set("rangerHbasePluginPropertiesTag", {
+ name: "rangerHbasePluginPropertiesTag",
+ value: rangerHbasePluginPropertiesTag
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'KAFKA')) {
+ if('ranger-kafka-audit' in data.Clusters.desired_configs) {
+ var rangerKafkaAuditTag = data.Clusters.desired_configs['ranger-kafka-audit'].tag;
+ urlParams.push('(type=ranger-kafka-audit&tag=' + rangerKafkaAuditTag + ')');
+ this.set("rangerKafkaAuditTag", {name: "rangerKafkaAuditTag", value: rangerKafkaAuditTag});
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'KNOX')) {
+ if('ranger-knox-audit' in data.Clusters.desired_configs) {
+ var rangerKnoxAuditTag = data.Clusters.desired_configs['ranger-knox-audit'].tag;
+ urlParams.push('(type=ranger-knox-audit&tag=' + rangerKnoxAuditTag + ')');
+ this.set("rangerKnoxAuditTag", {name: "rangerKnoxAuditTag", value: rangerKnoxAuditTag});
+ }
+ if('ranger-knox-plugin-properties' in data.Clusters.desired_configs) {
+ var rangerKnoxPluginPropertiesTag = data.Clusters.desired_configs['ranger-knox-plugin-properties'].tag;
+ urlParams.push('(type=ranger-knox-plugin-properties&tag=' + rangerKnoxPluginPropertiesTag + ')');
+ this.set("rangerKnoxPluginPropertiesTag", {
+ name: "rangerKnoxPluginPropertiesTag",
+ value: rangerKnoxPluginPropertiesTag
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'STORM')) {
+ if('ranger-storm-audit' in data.Clusters.desired_configs) {
+ var rangerStormAuditTag = data.Clusters.desired_configs['ranger-storm-audit'].tag;
+ urlParams.push('(type=ranger-storm-audit&tag=' + rangerStormAuditTag + ')');
+ this.set("rangerStormAuditTag", {name: "rangerStormAuditTag", value: rangerStormAuditTag});
+ }
+ if('ranger-storm-plugin-properties' in data.Clusters.desired_configs) {
+ var rangerStormPluginPropertiesTag = data.Clusters.desired_configs['ranger-storm-plugin-properties'].tag;
+ urlParams.push('(type=ranger-storm-plugin-properties&tag=' + rangerStormPluginPropertiesTag + ')');
+ this.set("rangerStormPluginPropertiesTag", {
+ name: "rangerStormPluginPropertiesTag",
+ value: rangerStormPluginPropertiesTag
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'ATLAS')) {
+ if('ranger-atlas-audit' in data.Clusters.desired_configs) {
+ var rangerAtlasAuditTag = data.Clusters.desired_configs['ranger-atlas-audit'].tag;
+ urlParams.push('(type=ranger-atlas-audit&tag=' + rangerAtlasAuditTag + ')');
+ this.set("rangerAtlasAuditTag", {name: "rangerAtlasAuditTag", value: rangerAtlasAuditTag});
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'HIVE')) {
+ if('ranger-hive-audit' in data.Clusters.desired_configs) {
+ var rangerHiveAuditTag = data.Clusters.desired_configs['ranger-hive-audit'].tag;
+ urlParams.push('(type=ranger-hive-audit&tag=' + rangerHiveAuditTag + ')');
+ this.set("rangerHiveAuditTag", {name: "rangerHiveAuditTag", value: rangerHiveAuditTag});
+ }
+ if('ranger-hive-plugin-properties' in data.Clusters.desired_configs) {
+ var rangerHivePluginPropertiesTag = data.Clusters.desired_configs['ranger-hive-plugin-properties'].tag;
+ urlParams.push('(type=ranger-hive-plugin-properties&tag=' + rangerHivePluginPropertiesTag + ')');
+ this.set("rangerHivePluginPropertiesTag", {
+ name: "rangerHivePluginPropertiesTag",
+ value: rangerHivePluginPropertiesTag
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'RANGER_KMS')) {
+ if('ranger-kms-audit' in data.Clusters.desired_configs) {
+ var rangerKMSAuditTag = data.Clusters.desired_configs['ranger-kms-audit'].tag;
+ urlParams.push('(type=ranger-kms-audit&tag=' + rangerKMSAuditTag + ')');
+ this.set("rangerKMSAuditTag", {name: "rangerKMSAuditTag", value: rangerKMSAuditTag});
+ }
+ }
+ }
App.ajax.send({
name: 'admin.get.all_configurations',
sender: this,
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/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 68366f6..7b20439 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
@@ -72,6 +72,20 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
*/
updateConfigProperties: function(data) {
var siteNames = ['hdfs-site','core-site'];
+ if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+ var hdfsPluginConfig = data.items.findProperty('type', 'ranger-hdfs-plugin-properties');
+ if (hdfsPluginConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in hdfsPluginConfig.properties) {
+ siteNames.push('ranger-hdfs-plugin-properties');
+ }
+ }
+ var hdfsAuditConfig = data.items.findProperty('type', 'ranger-hdfs-audit');
+ if (hdfsAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in hdfsAuditConfig.properties) {
+ siteNames.push('ranger-hdfs-audit');
+ }
+ }
+ }
var configData = this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
App.ajax.send({
name: 'common.service.configurations',
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js
index 0bfd1c9..ae27506 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step7_controller.js
@@ -22,7 +22,22 @@ App.HighAvailabilityWizardStep7Controller = App.HighAvailabilityProgressPageCont
name:"highAvailabilityWizardStep7Controller",
- commands: ['startZooKeeperServers', 'startNameNode'],
+ commands: ['startRanger', 'startZooKeeperServers', 'startNameNode'],
+
+ initializeTasks: function () {
+ this._super();
+
+ if (!App.Service.find().someProperty('serviceName', 'RANGER')) {
+ this.get('tasks').splice(this.get('tasks').findProperty('command', 'startRanger').get('id'), 1);
+ }
+ },
+
+ startRanger: function () {
+ var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'RANGER_ADMIN').mapProperty('hostName');
+ if(hostNames.length) {
+ this.updateComponent('RANGER_ADMIN', hostNames, "RANGER", "Start");
+ }
+ },
startZooKeeperServers: function () {
var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/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 05c6a58..3c220c1 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
@@ -22,7 +22,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
name:"highAvailabilityWizardStep9Controller",
- commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'installPXF', 'reconfigureHBase', 'reconfigureAccumulo', 'reconfigureHawq', 'deleteSNameNode', 'stopHDFS', 'startAllServices'],
+ commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'installPXF', 'reconfigureRanger', 'reconfigureHBase', 'reconfigureAccumulo', 'reconfigureHawq', 'deleteSNameNode', 'stopHDFS', 'startAllServices'],
hbaseSiteTag: "",
accumuloSiteTag: "",
@@ -40,6 +40,10 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
this.get('tasks').splice(this.get('tasks').findProperty('command', 'installPXF').get('id'), 1);
numSpliced = 1;
}
+ if (!App.Service.find().someProperty('serviceName', 'RANGER')) {
+ this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureRanger').get('id') - numSpliced, 1);
+ numSpliced++;
+ }
if (!App.Service.find().someProperty('serviceName', 'HBASE')) {
this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHBase').get('id') - numSpliced, 1);
numSpliced++;
@@ -88,9 +92,167 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
this.createInstallComponentTask('PXF', this.get('secondNameNodeHost'), "PXF");
},
+ reconfigureRanger: function () {
+ var data = this.get('content.serviceConfigProperties');
+ var siteNames = ['ranger-env'];
+ var configs = [];
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ if (App.Service.find().someProperty('serviceName', 'YARN')) {
+ siteNames = [];
+ var yarnAuditConfig = data.items.findProperty('type', 'ranger-yarn-audit');
+ if (yarnAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in yarnAuditConfig.properties) {
+ siteNames.push('ranger-yarn-audit');
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'STORM')) {
+ siteNames = [];
+ var stormPluginConfig = data.items.findProperty('type', 'ranger-storm-plugin-properties');
+ if (stormPluginConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in stormPluginConfig.properties) {
+ siteNames.push('ranger-storm-plugin-properties');
+ }
+ }
+ var stormAuditConfig = data.items.findProperty('type', 'ranger-storm-audit');
+ if (stormAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in stormAuditConfig.properties) {
+ siteNames.push('ranger-storm-audit');
+ }
+ }
+ if (siteNames.length) {
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'KAFKA')) {
+ siteNames = [];
+ var kafkaAuditConfig = data.items.findProperty('type', 'ranger-kafka-audit');
+ if (kafkaAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in kafkaAuditConfig.properties) {
+ siteNames.push('ranger-kafka-audit');
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'KNOX')) {
+ siteNames = [];
+ var knoxPluginConfig = data.items.findProperty('type', 'ranger-knox-plugin-properties');
+ if (knoxPluginConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in knoxPluginConfig.properties) {
+ siteNames.push('ranger-knox-plugin-properties');
+ }
+ }
+ var knoxAuditConfig = data.items.findProperty('type', 'ranger-knox-audit');
+ if (knoxAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in knoxAuditConfig.properties) {
+ siteNames.push('ranger-knox-audit');
+ }
+ }
+ if(siteNames.length) {
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'ATLAS')) {
+ siteNames = [];
+ var atlasAuditConfig = data.items.findProperty('type', 'ranger-atlas-audit');
+ if (atlasAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in atlasAuditConfig.properties) {
+ siteNames.push('ranger-atlas-audit');
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'HIVE')) {
+ siteNames = [];
+ var hivePluginConfig = data.items.findProperty('type', 'ranger-hive-plugin-properties');
+ if (hivePluginConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in hivePluginConfig.properties) {
+ siteNames.push('ranger-hive-plugin-properties');
+ }
+ }
+ var hiveAuditConfig = data.items.findProperty('type', 'ranger-hive-audit');
+ if (hiveAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in hiveAuditConfig.properties) {
+ siteNames.push('ranger-hive-audit');
+ }
+ }
+ if(siteNames.length) {
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ if (App.Service.find().someProperty('serviceName', 'RANGER_KMS')) {
+ siteNames = [];
+ var rangerKMSConfig = data.items.findProperty('type', 'ranger-kms-audit');
+ if (rangerKMSConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in rangerKMSConfig.properties) {
+ siteNames.push('ranger-kms-audit');
+ configs.push({
+ Clusters: {
+ desired_config: this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)))
+ }
+ });
+ }
+ }
+ }
+
+ App.ajax.send({
+ name: 'common.service.multiConfigurations',
+ sender: this,
+ data: {
+ configs: configs
+ },
+ success: 'saveConfigTag',
+ error: 'onTaskError'
+ });
+ },
+
reconfigureHBase: function () {
var data = this.get('content.serviceConfigProperties');
- var configData = this.reconfigureSites(['hbase-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
+ var siteNames = ['hbase-site'];
+ if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+ var hbasePluginConfig = data.items.findProperty('type', 'ranger-hbase-plugin-properties');
+ if (hbasePluginConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in hbasePluginConfig.properties) {
+ siteNames.push('ranger-hbase-plugin-properties');
+ }
+ }
+ var hbaseAuditConfig = data.items.findProperty('type', 'ranger-hbase-audit');
+ if (hbaseAuditConfig) {
+ if ('xasecure.audit.destination.hdfs.dir' in hbaseAuditConfig.properties) {
+ siteNames.push('ranger-hbase-audit');
+ }
+ }
+ }
+ var configData = this.reconfigureSites(siteNames, data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE', false)));
App.ajax.send({
name: 'common.service.configurations',
sender: this,
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
index 1e2f484..eebcd6e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
@@ -117,7 +117,13 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
_content.get('configs').forEach(function (_configProperties) {
var siteObj = data.items.findProperty('type', _configProperties.get('filename'));
if (siteObj) {
- siteObj.properties[_configProperties.get('name')] = _configProperties.get('value');
+ if (_configProperties.get('name') == 'xasecure.audit.destination.hdfs.dir') {
+ if('xasecure.audit.destination.hdfs.dir' in siteObj.properties) {
+ siteObj.properties[_configProperties.get('name')] = _configProperties.get('value');
+ }
+ } else {
+ siteObj.properties[_configProperties.get('name')] = _configProperties.get('value');
+ }
}
}, this);
this.setDBProperty('serviceConfigProperties', data);
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/ambari-web/app/data/HDP2/ha_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/ha_properties.js b/ambari-web/app/data/HDP2/ha_properties.js
index 388f85d..0275371 100644
--- a/ambari-web/app/data/HDP2/ha_properties.js
+++ b/ambari-web/app/data/HDP2/ha_properties.js
@@ -26,9 +26,10 @@ module.exports =
App.ServiceConfigCategory.create({ name: 'HBASE', displayName: 'HBase'}),
App.ServiceConfigCategory.create({ name: 'ACCUMULO', displayName: 'Accumulo'}),
App.ServiceConfigCategory.create({ name: 'AMBARI_METRICS', displayName: 'Ambari Metrics'}),
- App.ServiceConfigCategory.create({ name: 'HAWQ', displayName: 'HAWQ'})
+ App.ServiceConfigCategory.create({ name: 'HAWQ', displayName: 'HAWQ'}),
+ App.ServiceConfigCategory.create({ name: 'RANGER', displayName: 'Ranger'})
],
- sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 'ams-hbase-site', 'hawq-site', 'hdfs-client'],
+ sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 'ams-hbase-site', 'hawq-site', 'hdfs-client', 'ranger-env', 'ranger-knox-plugin-properties', 'ranger-kms-audit', 'ranger-storm-plugin-properties', 'ranger-hbase-plugin-properties', 'ranger-hdfs-plugin-properties', 'ranger-hive-plugin-properties', 'ranger-kafka-audit', 'ranger-knox-audit', 'ranger-hdfs-audit', 'ranger-hive-audit', 'ranger-atlas-audit', 'ranger-storm-audit', 'ranger-hbase-audit', 'ranger-yarn-audit'],
configs: [
/**********************************************HDFS***************************************/
{
@@ -264,6 +265,196 @@ module.exports =
"filename": "ams-hbase-site",
"serviceName": 'MISC'
},
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "RANGER",
+ "filename": "ranger-env",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "HDFS",
+ "filename": "ranger-hdfs-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "HDFS",
+ "isVisible": false,
+ "filename": "ranger-hdfs-plugin-properties",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "KAFKA",
+ "isVisible": false,
+ "filename": "ranger-kafka-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "KNOX",
+ "isVisible": false,
+ "filename": "ranger-knox-plugin-properties",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "RANGER_KMS",
+ "isVisible": false,
+ "filename": "ranger-kms-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "STORM",
+ "isVisible": false,
+ "filename": "ranger-storm-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "STORM",
+ "isVisible": false,
+ "filename": "ranger-storm-plugin-properties",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "HBASE",
+ "isVisible": false,
+ "filename": "ranger-hbase-plugin-properties",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "HIVE",
+ "isVisible": false,
+ "filename": "ranger-hive-plugin-properties",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "HBASE",
+ "isVisible": false,
+ "filename": "ranger-hbase-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "KNOX",
+ "isVisible": false,
+ "filename": "ranger-knox-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "HIVE",
+ "isVisible": false,
+ "filename": "ranger-hive-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "YARN",
+ "isVisible": false,
+ "filename": "ranger-yarn-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "ATLAS",
+ "isVisible": false,
+ "filename": "ranger-atlas-audit",
+ "serviceName": 'MISC'
+ },
+ {
+ "name": "xasecure.audit.destination.hdfs.dir",
+ "displayName": "Destination HDFS Directory",
+ "description": "HDFS folder to write audit to, make sure all service user has required permissions. This property is overridable at service level.",
+ "isReconfigurable": false,
+ "recommendedValue": "hdfs://haCluster",
+ "value": "hdfs://haCluster",
+ "category": "RANGER_KMS",
+ "isVisible": false,
+ "filename": "ranger-kms-audit",
+ "serviceName": 'MISC'
+ },
/**********************************************HAWQ***************************************/
{
"name": "hawq_dfs_url",
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 8f49cce..b35d2d1 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1362,19 +1362,21 @@ Em.I18n.translations = {
'admin.highAvailability.wizard.step5.task4.title':'Start JournalNodes',
'admin.highAvailability.wizard.step5.task5.title':'Disable Secondary NameNode',
- 'admin.highAvailability.wizard.step7.task0.title':'Start ZooKeeper Servers',
- 'admin.highAvailability.wizard.step7.task1.title':'Start NameNode',
+ 'admin.highAvailability.wizard.step7.task0.title':'Start Ranger',
+ 'admin.highAvailability.wizard.step7.task1.title':'Start ZooKeeper Servers',
+ 'admin.highAvailability.wizard.step7.task2.title':'Start NameNode',
'admin.highAvailability.wizard.step9.task0.title':'Start Additional NameNode',
'admin.highAvailability.wizard.step9.task1.title':'Install Failover Controllers',
'admin.highAvailability.wizard.step9.task2.title':'Start Failover Controllers',
'admin.highAvailability.wizard.step9.task3.title':'Install PXF',
- 'admin.highAvailability.wizard.step9.task4.title':'Reconfigure HBase',
- 'admin.highAvailability.wizard.step9.task5.title':'Reconfigure Accumulo',
- 'admin.highAvailability.wizard.step9.task6.title':'Reconfigure HAWQ',
- 'admin.highAvailability.wizard.step9.task7.title':'Delete Secondary NameNode',
- 'admin.highAvailability.wizard.step9.task8.title':'Stop HDFS',
- 'admin.highAvailability.wizard.step9.task9.title':'Start All Services',
+ 'admin.highAvailability.wizard.step9.task4.title':'Reconfigure Ranger',
+ 'admin.highAvailability.wizard.step9.task5.title':'Reconfigure HBase',
+ 'admin.highAvailability.wizard.step9.task6.title':'Reconfigure Accumulo',
+ 'admin.highAvailability.wizard.step9.task7.title':'Reconfigure HAWQ',
+ 'admin.highAvailability.wizard.step9.task8.title':'Delete Secondary NameNode',
+ 'admin.highAvailability.wizard.step9.task9.title':'Stop HDFS',
+ 'admin.highAvailability.wizard.step9.task10.title':'Start All Services',
'admin.highAvailability.wizard.step9.notice.completed':'NameNode HA has been enabled successfully.',
'admin.highAvailability.wizard.step3.curNameNode': '<b>Current NameNode:</b> ',
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/ambari-web/app/routes/high_availability_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/high_availability_routes.js b/ambari-web/app/routes/high_availability_routes.js
index 4ab36e4..a26beb3 100644
--- a/ambari-web/app/routes/high_availability_routes.js
+++ b/ambari-web/app/routes/high_availability_routes.js
@@ -177,6 +177,9 @@ module.exports = App.WizardRoute.extend({
if (App.Service.find().someProperty('serviceName', 'HBASE')) {
controller.saveConfigTag(stepController.get("hbaseSiteTag"));
}
+ if (App.Service.find().someProperty('serviceName', 'RANGER')) {
+ controller.saveConfigTag(stepController.get("rangerEnvTag"));
+ }
App.set('router.nextBtnClickInProgress', false);
router.transitionTo('step4');
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/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 e9b1e32..0a6719b 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -207,6 +207,17 @@ var urls = {
}
},
+ 'common.service.multiConfigurations': {
+ 'real':'/clusters/{clusterName}',
+ 'mock':'',
+ 'format': function (data) {
+ return {
+ type: 'PUT',
+ data: JSON.stringify(data.configs)
+ }
+ }
+ },
+
'common.across.services.configurations': {
'type': 'PUT',
'real':'/clusters/{clusterName}',
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/ambari-web/app/utils/configs/nn_ha_config_initializer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/nn_ha_config_initializer.js b/ambari-web/app/utils/configs/nn_ha_config_initializer.js
index 3a48e8d..599e7c9 100644
--- a/ambari-web/app/utils/configs/nn_ha_config_initializer.js
+++ b/ambari-web/app/utils/configs/nn_ha_config_initializer.js
@@ -128,7 +128,8 @@ App.NnHaConfigInitializer = App.HaConfigInitializerClass.create(App.HostsBasedIn
'hawq_dfs_url': '_initHawqDfsUrl',
'instance.volumes': '_initInstanceVolumes',
'instance.volumes.replacements': '_initInstanceVolumesReplacements',
- 'dfs.journalnode.edits.dir': '_initDfsJnEditsDir'
+ 'dfs.journalnode.edits.dir': '_initDfsJnEditsDir',
+ 'xasecure.audit.destination.hdfs.dir': '_initXasecureAuditDestinationHdfsDir'
},
initializerTypes: [
@@ -380,6 +381,33 @@ App.NnHaConfigInitializer = App.HaConfigInitializerClass.create(App.HostsBasedIn
});
}
return configProperty;
+ },
+
+ /**
+ * Unique initializer for <code>xasecure.audit.destination.hdfs.dir</code>
+ *
+ * @param {configProperty} configProperty
+ * @param {extendedTopologyLocalDB} localDB
+ * @param {nnHaConfigDependencies} dependencies
+ * @param {object} initializer
+ * @method _initXasecureAuditDestinationHdfsDir
+ * @return {object}
+ * @private
+ */
+ _initXasecureAuditDestinationHdfsDir: function(configProperty, localDB, dependencies, initializer) {
+ if (localDB.installedServices.contains('RANGER')) {
+ var oldValue = dependencies.serverConfigs.findProperty('type', 'ranger-env').properties['xasecure.audit.destination.hdfs.dir'];
+ // Example of value - hdfs://c6401.ambari.apache.org:8020/ranger/audit
+ // Replace hostname and port with Namespace
+ var valueArray = oldValue.split("/");
+ valueArray[2] = dependencies.namespaceId;
+ var newValue = valueArray.join("/");
+ Em.setProperties(configProperty, {
+ value: newValue,
+ recommendedValue: newValue
+ });
+ }
+ return configProperty;
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/06c07eda/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 dfe2076..10989e0 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
@@ -63,6 +63,12 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
properties: {
'hawq_dfs_url': 'localhost:8020/hawq_data'
}
+ },
+ {
+ type: 'ranger-env',
+ properties: {
+ 'xasecure.audit.destination.hdfs.dir': 'hdfs://c6401.ambari.apache.org/ranger/audit'
+ }
}
]
};
@@ -208,6 +214,7 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
var masterComponentHosts = [
{component: 'NAMENODE', isInstalled: true, hostName: 'h1'},
{component: 'NAMENODE', isInstalled: false, hostName: 'h2'},
+ {component: 'RANGER_ADMIN', isInstalled: true, hostName: 'h1'},
{component: 'JOURNALNODE', hostName: 'h1'},
{component: 'JOURNALNODE', hostName: 'h2'},
{component: 'JOURNALNODE', hostName: 'h3'},
@@ -226,7 +233,7 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
var get = sinon.stub(App, 'get');
get.withArgs('isHadoopWindowsStack').returns(true);
sinon.stub(App.Service, 'find', function () {
- return [{serviceName: 'HDFS'}, {serviceName: 'HBASE'}, {serviceName: 'AMBARI_METRICS'}, {serviceName: 'ACCUMULO'}, {serviceName: 'HAWQ'}]
+ return [{serviceName: 'HDFS'}, {serviceName: 'HBASE'}, {serviceName: 'AMBARI_METRICS'}, {serviceName: 'ACCUMULO'}, {serviceName: 'HAWQ'}, {serviceName: 'RANGER'}]
});
});
@@ -365,6 +372,13 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
filename: 'hawq-site'
},
value: nameServiceId + '/hawq_data'
+ },
+ {
+ config: {
+ name: 'xasecure.audit.destination.hdfs.dir',
+ filename: 'ranger-env'
+ },
+ value: 'hdfs://' + nameServiceId + '/ranger/audit'
}
]).forEach(function (test) {
describe(test.config.name, function () {
@@ -385,7 +399,7 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
it('name is ' + test.name, function () {
expect(configs[0].name).to.equal(test.name);
});
- it('displayNamr is' + test.name, function () {
+ it('displayName is' + test.name, function () {
expect(configs[0].displayName).to.equal(test.name);
});
}
@@ -413,6 +427,7 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
'ams-hbase-site': {tag: 'v6'},
'hawq-site': {tag: 'v7'},
'hdfs-client': {tag: 'v8'},
+ 'ranger-env': {tag: 'v9'}
}}};
beforeEach(function () {
@@ -421,7 +436,8 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
Em.Object.create({serviceName: 'HBASE'}),
Em.Object.create({serviceName: 'ACCUMULO'}),
Em.Object.create({serviceName: 'AMBARI_METRICS'}),
- Em.Object.create({serviceName: 'HAWQ'})
+ Em.Object.create({serviceName: 'HAWQ'}),
+ Em.Object.create({serviceName: 'RANGER'})
];
});
controller.onLoadConfigsTags(data);
@@ -433,7 +449,7 @@ describe('App.HighAvailabilityWizardStep3Controller', function() {
});
it('urlParams are valid', function () {
- expect(this.args[0].data.urlParams).to.be.equal('(type=hdfs-site&tag=v1)|(type=core-site&tag=v2)|(type=zoo.cfg&tag=v3)|(type=hbase-site&tag=v4)|(type=accumulo-site&tag=v5)|(type=ams-hbase-site&tag=v6)|(type=hawq-site&tag=v7)|(type=hdfs-client&tag=v8)');
+ expect(this.args[0].data.urlParams).to.be.equal('(type=hdfs-site&tag=v1)|(type=core-site&tag=v2)|(type=zoo.cfg&tag=v3)|(type=hbase-site&tag=v4)|(type=accumulo-site&tag=v5)|(type=ams-hbase-site&tag=v6)|(type=hawq-site&tag=v7)|(type=hdfs-client&tag=v8)|(type=ranger-env&tag=v9)');
});
});