Repository: ambari Updated Branches: refs/heads/trunk 405edb289 -> a97576641
AMBARI-8817. Issues with setting up Hive Metastore HA (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/85b89578 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/85b89578 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/85b89578 Branch: refs/heads/trunk Commit: 85b89578580f9caf0b199cb863ee8b980aff2e0e Parents: 405edb2 Author: Alex Antonenko <[email protected]> Authored: Fri Dec 19 15:38:18 2014 +0200 Committer: Alex Antonenko <[email protected]> Committed: Fri Dec 19 20:00:30 2014 +0200 ---------------------------------------------------------------------- ambari-web/app/app.js | 2 +- ambari-web/app/controllers/main/host/details.js | 38 +++++++++++++------- ambari-web/app/messages.js | 4 +-- .../app/models/stack_service_component.js | 9 +++-- ambari-web/test/app_test.js | 3 +- 5 files changed, 38 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/85b89578/ambari-web/app/app.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js index c9e19a9..33ed71c 100644 --- a/ambari-web/app/app.js +++ b/ambari-web/app/app.js @@ -260,7 +260,7 @@ module.exports = Em.Application.create({ }.property('App.router.clusterController.isLoaded'), addableMasterInstallerWizard: function () { - return App.StackServiceComponent.find().filterProperty('isMasterAddableInstallerWizard').mapProperty('componentName') + return App.StackServiceComponent.find().filterProperty('isMasterAddableInstallerWizard').filterProperty('showAddBtnInInstall').mapProperty('componentName') }.property('App.router.clusterController.isLoaded'), multipleMasters: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/85b89578/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 5b3aa5e..0a099ed 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -576,7 +576,7 @@ App.MainHostDetailsController = Em.Controller.extend({ name: 'admin.get.all_configurations', sender: this, data: { - urlParams: '(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')' + urlParams: '(type=hive-site&tag='+data.Clusters.desired_configs['hive-site'].tag+')|(type=webhcat-site&tag=' + data.Clusters.desired_configs['webhcat-site'].tag + ')' }, success: 'onLoadHiveConfigs' }); @@ -589,20 +589,34 @@ App.MainHostDetailsController = Em.Controller.extend({ */ onLoadHiveConfigs: function (data) { var hiveMSHosts = this.getHiveHosts(); + var configs = {}; + var port = ""; + + data.items.forEach(function (item) { + configs[item.type] = item.properties; + }, this); + + port = configs['hive-site']['hive.metastore.uris'].match(/:[0-9]{2,4}/); + port = port ? port[0].slice(1) : "9083"; for (var i = 0; i < hiveMSHosts.length; i++) { - hiveMSHosts[i] = "thrift://" + hiveMSHosts[i] + ":9083"; + hiveMSHosts[i] = "thrift://" + hiveMSHosts[i] + ":" + port; + } + configs['hive-site']['hive.metastore.uris'] = hiveMSHosts.join(','); + configs['webhcat-site']['templeton.hive.properties'] = configs['webhcat-site']['templeton.hive.properties'].replace(/thrift.+[0-9]{2,},/i, hiveMSHosts.join('\\,') + ","); + + for (var site in configs) { + if (!configs.hasOwnProperty(site)) continue; + App.ajax.send({ + name: 'reassign.save_configs', + sender: this, + data: { + siteName: site, + properties: configs[site], + service_config_version_note: Em.I18n.t('hosts.host.hive.configs.save.note') + } + }); } - data.items[0].properties['hive.metastore.uris'] = hiveMSHosts.join(','); - App.ajax.send({ - name: 'reassign.save_configs', - sender: this, - data: { - siteName: 'hive-site', - properties: data.items[0].properties, - service_config_version_note: Em.I18n.t('hosts.host.hive.configs.save.note') - } - }); }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/85b89578/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index edf3b47..e341751 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2068,8 +2068,8 @@ Em.I18n.translations = { 'hosts.host.hbase_regionserver.decommission.warning':'Last RegionServer can\'t be decommissioned', 'hosts.host.decommissioned':'Decommissioned', 'hosts.host.decommissioning':'Decommissioning', - 'hosts.host.addComponent.HIVE_METASTORE':'Adding Hive Metastore will reconfigure such properties:<ul><li>hive.metastore.uris</li></ul>', - 'hosts.host.deleteComponent.popup.deleteHiveMetastore':'Deleting <i>Hive Metastorer</i> reconfigure such properties:<ul><li>hive.metastore.uris</li></ul>', + 'hosts.host.addComponent.HIVE_METASTORE':'Adding <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>', + 'hosts.host.deleteComponent.popup.deleteHiveMetastore':'Deleting <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>', 'hosts.host.hive.configs.save.note': 'This configuration is created by ambari while installing/deleting hive component on a host', 'hosts.component.passive.implied.host.mode.tooltip':'Cannot Turn Off Maintenance Mode because Host is in Maintenance Mode', http://git-wip-us.apache.org/repos/asf/ambari/blob/85b89578/ambari-web/app/models/stack_service_component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js index 24017eb..770195a 100644 --- a/ambari-web/app/models/stack_service_component.js +++ b/ambari-web/app/models/stack_service_component.js @@ -144,8 +144,7 @@ App.StackServiceComponent = DS.Model.extend({ * @property {Boolean} isMasterAddableInstallerWizard **/ isMasterAddableInstallerWizard: function() { - var ignored = ['HIVE_METASTORE']; - return this.get('isMaster') && this.get('isMultipleAllowed') && this.get('maxToInstall') > 2 && !ignored.contains(this.get('componentName')); + return this.get('isMaster') && this.get('isMultipleAllowed') && this.get('maxToInstall') > 2; }.property('componentName'), /** @property {Boolean} isHAComponentOnly - Components that can be installed only if HA enabled **/ @@ -187,6 +186,12 @@ App.StackServiceComponent = DS.Model.extend({ isCoHostedComponent: function() { var componentName = this.get('componentName'); return !!App.StackServiceComponent.coHost[componentName]; + }.property('componentName'), + + /** @property {Boolean} showAddBtnInInstall - show add button for this component on Assign Masters **/ + showAddBtnInInstall: function() { + var doNotShowList = ['HIVE_METASTORE']; + return !doNotShowList.contains(this.get('componentName')); }.property('componentName') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/85b89578/ambari-web/test/app_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/app_test.js b/ambari-web/test/app_test.js index c5450e6..a62424e 100644 --- a/ambari-web/test/app_test.js +++ b/ambari-web/test/app_test.js @@ -407,7 +407,8 @@ describe('App', function () { data: [ Em.Object.create({ componentName: 'C9', - isMasterAddableInstallerWizard: true + isMasterAddableInstallerWizard: true, + showAddBtnInInstall: true }) ], result: ['C9']
