Browse Source

AMBARI-11435. Tell Ambari the value of topology.max.replication.wait.time.sec for Storm HA (dlysnichenko)

Lisnichenko Dmitro 10 years ago
parent
commit
90bd51a81b

+ 13 - 0
ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py

@@ -89,6 +89,19 @@ storm_zookeeper_servers = default('/configurations/storm-site/storm.zookeeper.se
 nimbus_seeds_supported = default('/configurations/storm-env/nimbus_seeds_supported', False)
 nimbus_host = default('/configurations/storm-site/nimbus.host', None)
 nimbus_seeds = default('/configurations/storm-site/nimbus.seeds', None)
+default_topology_max_replication_wait_time_sec = default('/configurations/storm-site/topology.max.replication.wait.time.sec.default', None)
+actual_topology_max_replication_wait_time_sec = default('/configurations/storm-site/topology.max.replication.wait.time.sec', None)
+nimbus_hosts = default("/clusterHostInfo/nimbus_hosts", [])
+actual_topology_min_replication_count = default('/configurations/storm-site/topology.min.replication.count', None)
+default_topology_min_replication_count = default('/configurations/storm-site/topology.min.replication.count.default', None)
+
+#Calculate topology.max.replication.wait.time.sec and topology.min.replication.count
+if len(nimbus_hosts) > 1:
+  actual_topology_max_replication_wait_time_sec = -1
+  actual_topology_min_replication_count = 2
+else:
+  actual_topology_max_replication_wait_time_sec = default_topology_max_replication_wait_time_sec
+  actual_topology_min_replication_count = default_topology_min_replication_count  
 
 rest_api_port = "8745"
 rest_api_admin_port = "8746"

+ 16 - 6
ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/storm-site.xml

@@ -25,15 +25,25 @@
     <description>Comma-delimited list of the hosts running nimbus server.</description>
   </property>
   <property>
-    <name>topology.min.replication.count</name>
+    <name>topology.min.replication.count.default</name>
     <value>1</value>
-    <description> Minimum number of nimbus hosts where the code must be replicated before leader nimbus can mark the topology as active and create assignments. </description>
+    <description>Dafault minimum number of nimbus hosts where the code must be replicated before leader nimbus can mark the topology as active and create assignments. </description>
   </property>
-   <property>
-      <name>topology.max.replication.wait.time.sec</name>
+  <property>
+    <name>topology.min.replication.count</name>
+    <value>{{actual_topology_min_replication_count}}</value>
+    <description>Calculated minimum number of nimbus hosts where the code must be replicated before leader nimbus can mark the topology as active and create assignments. </description>
+  </property>  
+  <property>
+      <name>topology.max.replication.wait.time.sec.default</name>
       <value>60</value>
-      <description>Maximum wait time for the nimbus host replication to achieve the nimbus.min.replication.count. Once this time is elapsed nimbus will go ahead and perform topology activation tasks even if required nimbus.min.replication.count is not achieved</description>
-   </property>
+      <description>Default maximum wait time for the nimbus host replication to achieve the nimbus.min.replication.count. Once this time is elapsed nimbus will go ahead and perform topology activation tasks even if required nimbus.min.replication.count is not achieved</description>
+  </property>
+  <property>
+      <name>topology.max.replication.wait.time.sec</name>
+      <value>{{actual_topology_max_replication_wait_time_sec}}</value>
+      <description>Calculated maximum wait time for the nimbus host replication to achieve the nimbus.min.replication.count. Once this time is elapsed nimbus will go ahead and perform topology activation tasks even if required nimbus.min.replication.count is not achieved</description>
+  </property>  
    <property>
     <name>nimbus.host</name>
     <value>localhost</value>

+ 16 - 6
ambari-server/src/main/resources/stacks/HDPWIN/2.3/services/STORM/configuration/storm-site.xml

@@ -25,15 +25,25 @@
     <description>Comma-delimited list of the hosts running nimbus server.</description>
   </property>
   <property>
-    <name>topology.min.replication.count</name>
+    <name>topology.min.replication.count.default</name>
     <value>1</value>
-    <description> Minimum number of nimbus hosts where the code must be replicated before leader nimbus can mark the topology as active and create assignments. </description>
+    <description>Dafault minimum number of nimbus hosts where the code must be replicated before leader nimbus can mark the topology as active and create assignments. </description>
   </property>
-   <property>
-      <name>topology.max.replication.wait.time.sec</name>
+  <property>
+    <name>topology.min.replication.count</name>
+    <value>{{actual_topology_min_replication_count}}</value>
+    <description>Calculated minimum number of nimbus hosts where the code must be replicated before leader nimbus can mark the topology as active and create assignments. </description>
+  </property>  
+  <property>
+      <name>topology.max.replication.wait.time.sec.default</name>
       <value>60</value>
-      <description>Maximum wait time for the nimbus host replication to achieve the nimbus.min.replication.count. Once this time is elapsed nimbus will go ahead and perform topology activation tasks even if required nimbus.min.replication.count is not achieved</description>
-   </property>
+      <description>Default maximum wait time for the nimbus host replication to achieve the nimbus.min.replication.count. Once this time is elapsed nimbus will go ahead and perform topology activation tasks even if required nimbus.min.replication.count is not achieved</description>
+  </property>
+  <property>
+      <name>topology.max.replication.wait.time.sec</name>
+      <value>{{actual_topology_max_replication_wait_time_sec}}</value>
+      <description>Calculated maximum wait time for the nimbus host replication to achieve the nimbus.min.replication.count. Once this time is elapsed nimbus will go ahead and perform topology activation tasks even if required nimbus.min.replication.count is not achieved</description>
+  </property> 
    <property>
     <name>nimbus.host</name>
     <value>localhost</value>

+ 0 - 11
ambari-web/app/controllers/main/host/details.js

@@ -703,17 +703,6 @@ App.MainHostDetailsController = Em.Controller.extend({
     }, this);
 
     configs['storm-site']['nimbus.seeds'] = JSON.stringify(stormNimbusHosts).replace(/"/g, "'");
-
-    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: {