Updated Branches: refs/heads/branch-1.4.1 3baa99008 -> aef29ef22
AMBARI-3491: HBase Master/RegionServer can no longer be started after reconfiguring HBase or HDFS with NameNode HA enabled. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/aef29ef2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/aef29ef2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/aef29ef2 Branch: refs/heads/branch-1.4.1 Commit: aef29ef225038cb72b98a6aee6f5ca64534987b3 Parents: 3baa990 Author: Jaimin Jetly <[email protected]> Authored: Wed Oct 9 20:45:50 2013 -0700 Committer: Jaimin Jetly <[email protected]> Committed: Wed Oct 9 20:45:50 2013 -0700 ---------------------------------------------------------------------- .../app/controllers/wizard/step8_controller.js | 2 +- ambari-web/app/data/HDP2/config_mapping.js | 65 ++++++++++++++------ ambari-web/app/utils/config.js | 2 +- 3 files changed, 47 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/aef29ef2/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 798afcf..78a9151 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -29,7 +29,7 @@ App.WizardStep8Controller = Em.Controller.extend({ globals: [], ajaxQueue: [], configMapping: function(){ - return App.config.get('configMapping').all(); + return App.config.get('configMapping').all(true); }.property('App.config.configMapping'), slaveComponentConfig: null, http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/aef29ef2/ambari-web/app/data/HDP2/config_mapping.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/config_mapping.js b/ambari-web/app/data/HDP2/config_mapping.js index 318ed0e..e260017 100644 --- a/ambari-web/app/data/HDP2/config_mapping.js +++ b/ambari-web/app/data/HDP2/config_mapping.js @@ -16,13 +16,17 @@ * limitations under the License. */ +var App = require('app'); var configs = [ - /**********************************************core-site***************************************/ +/**********************************************core-site***************************************/ { "name": "fs.defaultFS", "templateName": ["namenode_host"], "foreignKey": null, "value": "hdfs://<templateName[0]>:8020", + "precondition": function () { + return (App.HDFSService.find('HDFS') && App.HDFSService.find('HDFS').get('snameNode')); + }, "filename": "core-site.xml" }, { @@ -52,7 +56,7 @@ var configs = [ "foreignKey": ["hive_user"], "value": "<templateName[0]>", "filename": "core-site.xml", - "isOverridable" : true + "isOverridable": true }, { "name": "hadoop.proxyuser.<foreignKey[0]>.hosts", @@ -60,7 +64,7 @@ var configs = [ "foreignKey": ["hive_user"], "value": "<templateName[0]>", "filename": "core-site.xml", - "isOverridable" : true + "isOverridable": true }, { "name": "hadoop.proxyuser.<foreignKey[0]>.groups", @@ -68,7 +72,7 @@ var configs = [ "foreignKey": ["oozie_user"], "value": "<templateName[0]>", "filename": "core-site.xml", - "isOverridable" : true + "isOverridable": true }, { "name": "hadoop.proxyuser.<foreignKey[0]>.hosts", @@ -76,7 +80,7 @@ var configs = [ "foreignKey": ["oozie_user"], "value": "<templateName[0]>", "filename": "core-site.xml", - "isOverridable" : true + "isOverridable": true }, { "name": "hadoop.proxyuser.<foreignKey[0]>.groups", @@ -84,7 +88,7 @@ var configs = [ "foreignKey": ["webhcat_user"], "value": "<templateName[0]>", "filename": "core-site.xml", - "isOverridable" : true + "isOverridable": true }, { "name": "hadoop.proxyuser.<foreignKey[0]>.hosts", @@ -92,9 +96,9 @@ var configs = [ "foreignKey": ["webhcat_user"], "value": "<templateName[0]>", "filename": "core-site.xml", - "isOverridable" : true + "isOverridable": true }, - /**********************************************hdfs-site***************************************/ +/**********************************************hdfs-site***************************************/ { "name": "dfs.namenode.name.dir", "templateName": ["dfs_namenode_name_dir"], @@ -187,7 +191,7 @@ var configs = [ "value": "<templateName[0]>", "filename": "hdfs-site.xml" }, - /**********************************************oozie-site***************************************/ +/**********************************************oozie-site***************************************/ { "name": "oozie.base.url", "templateName": ["oozieserver_host"], @@ -237,7 +241,7 @@ var configs = [ "value": "<templateName[0]>", "filename": "oozie-site.xml" }, - /**********************************************hive-site***************************************/ +/**********************************************hive-site***************************************/ { "name": "javax.jdo.option.ConnectionDriverName", "templateName": [], @@ -340,12 +344,15 @@ var configs = [ "filename": "mapred-site.xml" }, - /**********************************************hbase-site***************************************/ +/**********************************************hbase-site***************************************/ { "name": "hbase.rootdir", "templateName": ["namenode_host", "hbase_hdfs_root_dir"], "foreignKey": null, "value": "hdfs://<templateName[0]>:8020<templateName[1]>", + "precondition": function () { + return (App.HDFSService.find('HDFS') && App.HDFSService.find('HDFS').get('snameNode')); + }, "filename": "hbase-site.xml" }, { @@ -509,7 +516,7 @@ var configs = [ "value": "/hbase-unsecure", "filename": "hbase-site.xml" }, - /**********************************************webhcat-site***************************************/ +/**********************************************webhcat-site***************************************/ { "name": "templeton.zookeeper.hosts", "templateName": ["zookeeperserver_hosts"], @@ -526,13 +533,31 @@ var configs = [ * @type {Object} */ module.exports = { - all : function(){ - return configs.slice(0); - }, - overridable: function(){ - return configs.filterProperty('foreignKey'); - }, - computed: function(){ - return configs.filterProperty('foreignKey', null); + + checkPrecondition: function () { + return configs.filter(function (config) { + return ((!config.precondition) || (config.precondition())); + }); + }, + all: function (skipPreconditionCheck) { + if (skipPreconditionCheck) { + return configs.slice(0); + } else { + return this.checkPrecondition().slice(0); + } + }, + overridable: function (skipPreconditionCheck) { + if (skipPreconditionCheck) { + return configs.filterProperty('foreignKey'); + } else { + return this.checkPrecondition().filterProperty('foreignKey'); + } + }, + computed: function (skipPreconditionCheck) { + if (skipPreconditionCheck) { + return configs.filterProperty('foreignKey', null); + } else { + return this.checkPrecondition().filterProperty('foreignKey', null); + } } }; http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/aef29ef2/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index 61abc9a..731a988 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -110,7 +110,7 @@ App.config = Em.Object.create({ }.property('App.isHadoop2Stack'), /** - * + * Function should be used post-install as precondition check should not be done only after installer wizard * @param siteNames * @returns {Array} */
