Browse Source

AMBARI-15429. Cannot specify ZooKeeper heap size via UI.(vbrodetskyi)

Vitaly Brodetskyi 9 năm trước cách đây
mục cha
commit
d7596e769f

+ 15 - 1
ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/configuration/zookeeper-env.xml

@@ -54,6 +54,20 @@
     </value-attributes>
   </property>
 
+  <property>
+    <name>zk_server_heapsize</name>
+    <value>1024</value>
+    <description>Maximum amount of memory each Zookeeper Server can use.</description>
+    <display-name>Zookeeper Server Maximum Memory</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>256</minimum>
+      <maximum>32768</maximum>
+      <unit>MB</unit>
+      <increment-step>256</increment-step>
+    </value-attributes>
+  </property>
+
   <property>
     <name>zookeeper_principal_name</name>
     <description>ZooKeeper principal name</description>
@@ -74,7 +88,7 @@ export JAVA_HOME={{java64_home}}
 export ZOOKEEPER_HOME={{zk_home}}
 export ZOO_LOG_DIR={{zk_log_dir}}
 export ZOOPIDFILE={{zk_pid_file}}
-export SERVER_JVMFLAGS={{zk_server_heapsize}}
+export SERVER_JVMFLAGS=-Xmx{{zk_server_heapsize}}
 export JAVA=$JAVA_HOME/bin/java
 export CLASSPATH=$CLASSPATH:/usr/share/zookeeper/*
 

+ 1 - 1
ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py

@@ -65,7 +65,7 @@ zk_log_dir = config['configurations']['zookeeper-env']['zk_log_dir']
 zk_data_dir = config['configurations']['zoo.cfg']['dataDir']
 zk_pid_dir = status_params.zk_pid_dir
 zk_pid_file = status_params.zk_pid_file
-zk_server_heapsize = "-Xmx1024m"
+zk_server_heapsize = default('configurations/zookeeper-env/zk_server_heapsize', 1024)
 
 client_port = default('/configurations/zoo.cfg/clientPort', None)