Repository: ambari Updated Branches: refs/heads/trunk d9a834983 -> 9c3e5dd22
AMBARI-11099. Implement UI for Nimbus HA (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9c3e5dd2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9c3e5dd2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9c3e5dd2 Branch: refs/heads/trunk Commit: 9c3e5dd22c110d6ecc6fb26b211130a8efb1ffb5 Parents: d9a8349 Author: Aleksandr Kovalenko <akovale...@hortonworks.com> Authored: Wed May 13 13:24:15 2015 +0300 Committer: Aleksandr Kovalenko <akovale...@hortonworks.com> Committed: Wed May 13 13:46:50 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 74 +++++++++++--------- ambari-web/app/controllers/main/service/item.js | 4 +- ambari-web/app/messages.js | 4 +- ambari-web/app/views/main/service/item.js | 6 ++ 4 files changed, 52 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9c3e5dd2/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 02d02ad..05335aa 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -680,38 +680,48 @@ App.MainHostDetailsController = Em.Controller.extend({ * @method onLoadStormConfigs */ onLoadStormConfigs: function (data) { - var - nimbusHost = this.get('nimbusHost'), - stormNimbusHosts = this.getStormNimbusHosts(), - configs = {}, - attributes = {}; - - data.items.forEach(function (item) { - configs[item.type] = item.properties; - attributes[item.type] = item.properties_attributes || {}; - }, this); - - configs['storm-site']['nimbus.seeds'] = stormNimbusHosts.join(','); - var groups = [ - { - properties: { - 'storm-site': configs['storm-site'], - 'storm-env': configs['storm-env'] - }, - properties_attributes: { - 'storm-site': attributes['storm-site'], - 'storm-env': attributes['storm-env'] - } - }, - { - properties: { - 'core-site': configs['core-site'] - }, - properties_attributes: { - 'core-site': attributes['core-site'] - } - } - ]; + var nimbusHost = this.get('nimbusHost'), + stormNimbusHosts = this.getStormNimbusHosts(), + configs = {}, + attributes = {}; + + data.items.forEach(function (item) { + configs[item.type] = item.properties; + attributes[item.type] = item.properties_attributes || {}; + }, this); + + configs['storm-site']['nimbus.seeds'] = stormNimbusHosts.join(','); + + if (stormNimbusHosts.length > 1) { + // for HA Nimbus + configs['storm-site']['topology.max.replication.wait.time.sec'] = '-1'; + configs['storm-site']['topology.min.replication.count'] = '2'; + } else { + // for non-HA Nimbus + configs['storm-site']['topology.max.replication.wait.time.sec'] = App.StackConfigProperty.find().findProperty('name', 'topology.max.replication.wait.time.sec').get('value'); + configs['storm-site']['topology.min.replication.count'] = App.StackConfigProperty.find().findProperty('name', 'topology.min.replication.count').get('value'); + } + + var groups = [ + { + properties: { + 'storm-site': configs['storm-site'], + 'storm-env': configs['storm-env'] + }, + properties_attributes: { + 'storm-site': attributes['storm-site'], + 'storm-env': attributes['storm-env'] + } + }, + { + properties: { + 'core-site': configs['core-site'] + }, + properties_attributes: { + 'core-site': attributes['core-site'] + } + } + ]; this.saveConfigsBatch(groups, 'NIMBUS', nimbusHost); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/9c3e5dd2/ambari-web/app/controllers/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js index 62f28e3..ad33b98 100644 --- a/ambari-web/app/controllers/main/service/item.js +++ b/ambari-web/app/controllers/main/service/item.js @@ -54,7 +54,7 @@ App.MainServiceItemController = Em.Controller.extend({ var hostNames = App.Host.find().mapProperty('hostName'); this.set('allHosts', hostNames); - ['HBASE_MASTER', 'HIVE_METASTORE', 'ZOOKEEPER_SERVER', 'FLUME_HANDLER', 'HIVE_SERVER', 'RANGER_KMS_SERVER'].forEach(function(componentName) { + ['HBASE_MASTER', 'HIVE_METASTORE', 'ZOOKEEPER_SERVER', 'FLUME_HANDLER', 'HIVE_SERVER', 'RANGER_KMS_SERVER', 'NIMBUS'].forEach(function(componentName) { self.loadHostsWithoutComponent(componentName); }); } @@ -683,7 +683,7 @@ App.MainServiceItemController = Em.Controller.extend({ var selectedHost = this.get('selectedHost'); // Install - if(['HIVE_METASTORE', 'RANGER_KMS_SERVER'].contains(component.get('componentName')) && !!selectedHost){ + if(['HIVE_METASTORE', 'RANGER_KMS_SERVER', 'NIMBUS'].contains(component.get('componentName')) && !!selectedHost){ App.router.get('mainHostDetailsController').addComponent( { context: component, http://git-wip-us.apache.org/repos/asf/ambari/blob/9c3e5dd2/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 3bc1cab..18238bd 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2164,7 +2164,7 @@ Em.I18n.translations = { 'hosts.host.installComponent.msg':'Are you sure you want to install {0}?', 'hosts.host.addComponent.msg':'Are you sure you want to add {0}?', 'hosts.host.addComponent.ZOOKEEPER_SERVER':'Adding ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li></ul>', - 'hosts.host.addComponent.NIMBUS': 'Adding Nimbus will reconfigure the <b>nimbus.seeds</b> property if it is defined.', + 'hosts.host.addComponent.NIMBUS': 'Adding Nimbus will reconfigure <b>nimbus.seeds</b>, <b>topology.min.replication.count</b>, <b>topology.max.replication.wait.time.sec</b> properties if they are defined.', 'hosts.host.addComponent.RANGER_KMS_SERVER': 'Adding Ranger KMS Server may reconfigure such properties:<ul><li>hadoop.security.key.provider.path</li><li>dfs.encryption.key.provider.uri</li>', 'hosts.host.addComponent.deleteHostWithZooKeeper':'Deleting host with ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li></ul>', 'host.host.addComponent.popup.dependedComponents.body': '{0} requires {1} to be installed along with it on the same host. Please add them first and then try adding {0}', @@ -2173,7 +2173,7 @@ Em.I18n.translations = { 'hosts.host.zooKeeper.configs.save.note': 'This configuration is created by ambari while installing/deleting zookeeper component on a host', 'hosts.host.addComponent.securityNote':'You are running your cluster in secure mode. You must set up the keytab for {0} on {1} before you proceed. Otherwise, the component will not be able to start properly.', 'hosts.host.addComponent.popup.confirm':'Confirm Add', - 'hosts.host.deleteComponent.popup.deleteNimbus':'Deleting <i>Storm Nimbus</i> will reconfigure the <b>nimbus.seeds</b> property if it is defined.', + 'hosts.host.deleteComponent.popup.deleteNimbus':'Deleting <i>Storm Nimbus</i> will reconfigure <b>nimbus.seeds</b>, <b>topology.min.replication.count</b>, <b>topology.max.replication.wait.time.sec</b> properties if they are defined.', 'hosts.host.storm.configs.save.note': 'This configuration is created by ambari while installing/deleting storm component on a host', 'hosts.host.datanode.decommission':'Decommission DataNode', 'hosts.host.datanode.recommission':'Recommission DataNode', http://git-wip-us.apache.org/repos/asf/ambari/blob/9c3e5dd2/ambari-web/app/views/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js index 25044e7..71af4b8 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -83,6 +83,12 @@ App.MainServiceItemView = Em.View.extend({ 'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('RANGER_KMS_SERVER')), service: 'RANGER_KMS', component: 'RANGER_KMS_SERVER' + }, + { + cssClass: 'icon-plus', + 'label': '{0} {1}'.format(Em.I18n.t('add'), App.format.role('NIMBUS')), + service: 'STORM', + component: 'NIMBUS' } ] },