You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by bi...@apache.org on 2015/05/22 16:40:19 UTC
ambari git commit: AMBARI-10420 Configure Accumulo in the HA wizard
(billie)
Repository: ambari
Updated Branches:
refs/heads/trunk a2dcc044c -> ee1353709
AMBARI-10420 Configure Accumulo in the HA wizard (billie)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ee135370
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ee135370
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ee135370
Branch: refs/heads/trunk
Commit: ee13537090ceee904f8822de77fd9143eb2d212b
Parents: a2dcc04
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Fri May 22 07:39:00 2015 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Fri May 22 07:39:20 2015 -0700
----------------------------------------------------------------------
.../nameNode/rollback_controller.js | 34 ++++++++++++++++++++
.../nameNode/step3_controller.js | 14 ++++++++
.../nameNode/step9_controller.js | 22 ++++++++++++-
.../app/controllers/wizard/step7_controller.js | 9 ++++++
ambari-web/app/data/HDP2/ha_properties.js | 27 ++++++++++++++--
ambari-web/app/messages.js | 5 +--
6 files changed, 106 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ee135370/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
index e746de7..e86b52e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
@@ -33,6 +33,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
commands: [
'stopAllServices',
'restoreHBaseConfigs',
+ 'restoreAccumuloConfigs',
'stopFailoverControllers',
'deleteFailoverControllers',
'stopStandbyNameNode',
@@ -68,6 +69,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
'deleteSNameNode',
'startAllServices',
'reconfigureHBase',
+ 'reconfigureAccumulo',
'startZKFC',
'installZKFC',
'startSecondNameNode',
@@ -95,6 +97,10 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
if (!App.Service.find().someProperty('serviceName', 'HBASE') && hbaseTask) {
this.get('tasks').splice(hbaseTask.get('id'), 1);
}
+ var accumuloTask = this.get('tasks').findProperty('command', 'restoreAccumuloConfigs');
+ if (!App.Service.find().someProperty('serviceName', 'ACCUMULO') && accumuloTask) {
+ this.get('tasks').splice(accumuloTask.get('id'), 1);
+ }
},
clearStep: function () {
@@ -234,6 +240,20 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
error: 'onTaskError'
});
},
+ restoreAccumuloConfigs: function(){
+ console.warn('func: restoreAccumuloConfigs');
+ this.loadConfigTag("accumuloSiteTag");
+ var accumuloSiteTag = this.get("content.accumuloSiteTag");
+ App.ajax.send({
+ name: 'admin.high_availability.load_accumulo_configs',
+ sender: this,
+ data: {
+ accumuloSiteTag: accumuloSiteTag
+ },
+ success: 'onLoadAccumuloConfigs',
+ error: 'onTaskError'
+ });
+ },
stopFailoverControllers: function(){
console.warn('func: stopFailoverControllers');
@@ -309,6 +329,20 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
error: 'onTaskError'
});
},
+ onLoadAccumuloConfigs: function (data) {
+ console.warn('func: onLoadAccumuloConfigs');
+ var accumuloSiteProperties = data.items.findProperty('type', 'accumulo-site').properties;
+ App.ajax.send({
+ name: 'admin.high_availability.save_configs',
+ sender: this,
+ data: {
+ siteName: 'accumulo-site',
+ properties: accumuloSiteProperties
+ },
+ success: 'onTaskCompleted',
+ error: 'onTaskError'
+ });
+ },
onDeletedHDFSClient: function () {
console.warn('func: onDeletedHDFSClient');
http://git-wip-us.apache.org/repos/asf/ambari/blob/ee135370/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 193b89f..cf2d971 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
@@ -71,6 +71,11 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
urlParams.push('(type=hbase-site&tag=' + hbaseSiteTag + ')');
this.set("hbaseSiteTag", {name : "hbaseSiteTag", value : hbaseSiteTag});
}
+ if (App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
+ var accumuloSiteTag = data.Clusters.desired_configs['accumulo-site'].tag;
+ urlParams.push('(type=accumulo-site&tag=' + accumuloSiteTag + ')');
+ this.set("accumuloSiteTag", {name : "accumuloSiteTag", value : accumuloSiteTag});
+ }
App.ajax.send({
name: 'admin.get.all_configurations',
sender: this,
@@ -137,6 +142,15 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
var value = this.get('serverConfigData.items').findProperty('type', 'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + nameServiceId);
this.setConfigInitialValue(config,value);
}
+ config = configs.findProperty('name','instance.volumes');
+ var config2 = configs.findProperty('name','instance.volumes.replacements');
+ if (App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
+ var oldValue = this.get('serverConfigData.items').findProperty('type', 'accumulo-site').properties['instance.volumes'];
+ var value = oldValue.replace(/\/\/[^\/]*/, '//' + nameServiceId);
+ var replacements = oldValue + " " + value;
+ this.setConfigInitialValue(config,value);
+ this.setConfigInitialValue(config2,replacements)
+ }
config = configs.findProperty('name','dfs.journalnode.edits.dir');
if (App.get('isHadoopWindowsStack') && App.Service.find().someProperty('serviceName', 'HDFS')) {
var value = this.get('serverConfigData.items').findProperty('type', 'hdfs-site').properties['dfs.journalnode.edits.dir'];
http://git-wip-us.apache.org/repos/asf/ambari/blob/ee135370/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 4a92447..8f6b552 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,14 +22,20 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
name:"highAvailabilityWizardStep9Controller",
- commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'reconfigureHBase', 'deleteSNameNode', 'startAllServices'],
+ commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'reconfigureHBase', 'reconfigureAccumulo', 'deleteSNameNode', 'startAllServices'],
hbaseSiteTag: "",
+ accumuloSiteTag: "",
initializeTasks: function () {
this._super();
+ var numSpliced = 0;
if (!App.Service.find().someProperty('serviceName', 'HBASE')) {
this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHBase').get('id'), 1);
+ numSpliced = 1;
+ }
+ if (!App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
+ this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureAccumulo').get('id') - numSpliced, 1);
}
},
@@ -71,6 +77,20 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
});
},
+ reconfigureAccumulo: function () {
+ var data = this.get('content.serviceConfigProperties');
+ var configData = this.reconfigureSites(['accumulo-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+ App.ajax.send({
+ name: 'common.service.configurations',
+ sender: this,
+ data: {
+ desired_config: configData
+ },
+ success: 'saveConfigTag',
+ error: 'onTaskError'
+ });
+ },
+
saveConfigTag: function () {
App.clusterStatus.setClusterStatus({
clusterName: this.get('content.cluster.name'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/ee135370/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index fceb16c..e1faf39 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -769,6 +769,15 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
'recommendedValue' : valueToChange
});
}
+ if(this.get('selectedServiceNames').contains('ACCUMULO') && nameServiceId){
+ var vols = serviceConfigs.findProperty('serviceName', 'ACCUMULO').configs.findProperty('name','instance.volumes'),
+ valueToChange = vols.get('value').replace(/\/\/.*:[0-9]+/i, '//' + nameServiceId.get('value'));
+
+ vols.setProperties({
+ 'value': valueToChange,
+ 'recommendedValue' : valueToChange
+ });
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ee135370/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 63daf49..a16b07d 100644
--- a/ambari-web/app/data/HDP2/ha_properties.js
+++ b/ambari-web/app/data/HDP2/ha_properties.js
@@ -23,9 +23,10 @@ module.exports =
displayName: 'MISC',
configCategories: [
App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'}),
- App.ServiceConfigCategory.create({ name: 'HBASE', displayName: 'HBase'})
+ App.ServiceConfigCategory.create({ name: 'HBASE', displayName: 'HBase'}),
+ App.ServiceConfigCategory.create({ name: 'ACCUMULO', displayName: 'Accumulo'})
],
- sites: ['core-site', 'hdfs-site','hbase-site'],
+ sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site'],
configs: [
/**********************************************HDFS***************************************/
{
@@ -234,6 +235,28 @@ module.exports =
"category": "HBASE",
"filename": "hbase-site",
"serviceName": 'MISC'
+ },
+ {
+ "id": "site property",
+ "name": "instance.volumes",
+ "displayName": "instance.volumes",
+ "isReconfigurable": false,
+ "recommendedValue": "/hadoop/hdfs/journal",
+ "value": "/hadoop/hdfs/journal",
+ "category": "ACCUMULO",
+ "filename": "accumulo-site",
+ "serviceName": 'MISC'
+ },
+ {
+ "id": "site property",
+ "name": "instance.volumes.replacements",
+ "displayName": "instance.volumes.replacements",
+ "isReconfigurable": false,
+ "recommendedValue": "/hadoop/hdfs/journal",
+ "value": "/hadoop/hdfs/journal",
+ "category": "ACCUMULO",
+ "filename": "accumulo-site",
+ "serviceName": 'MISC'
}
]
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ee135370/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 15e275a..13a7d44 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1131,8 +1131,9 @@ Em.I18n.translations = {
'admin.highAvailability.wizard.step9.task1.title':'Install Failover Controllers',
'admin.highAvailability.wizard.step9.task2.title':'Start Failover Controllers',
'admin.highAvailability.wizard.step9.task3.title':'Reconfigure HBase',
- 'admin.highAvailability.wizard.step9.task4.title':'Delete Secondary NameNode',
- 'admin.highAvailability.wizard.step9.task5.title':'Start All Services',
+ 'admin.highAvailability.wizard.step9.task4.title':'Reconfigure Accumulo',
+ 'admin.highAvailability.wizard.step9.task5.title':'Delete Secondary NameNode',
+ 'admin.highAvailability.wizard.step9.task6.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> ',