浏览代码

AMBARI-11727 Perf: Set appropriate ulimit values for Metrics Hbase Master and Collector processes (dsen)

Dmytro Sen 10 年之前
父节点
当前提交
d1ccd28438

+ 7 - 0
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-env.xml

@@ -69,6 +69,13 @@
         sum of master and regionserver heap sizes.
     </description>
   </property>
+  <property>
+    <name>max_open_files_limit</name>
+    <value>32768</value>
+    <description>
+        The maximum number of open file descriptors by process
+    </description>
+  </property>
 
   <!-- hbase-env.sh -->
   <property>

+ 15 - 0
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py

@@ -245,6 +245,21 @@ def ams(name=None):
          mode=0755
     )
 
+    # On some OS this folder could be not exists, so we will create it before pushing there files
+    Directory(params.limits_conf_dir,
+              recursive=True,
+              owner='root',
+              group='root'
+    )
+
+    # Setting up security limits
+    File(os.path.join(params.limits_conf_dir, 'ams.conf'),
+         owner='root',
+         group='root',
+         mode=0644,
+         content=Template("ams.conf.j2")
+    )
+
     # Phoenix spool file dir if not /tmp
     if not os.path.exists(params.phoenix_client_spool_dir):
       Directory(params.phoenix_client_spool_dir,

+ 2 - 0
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py

@@ -110,6 +110,8 @@ if not is_hbase_distributed:
 else:
   hbase_heapsize = master_heapsize
 
+max_open_files_limit = default("/configurations/ams-hbase-env/max_open_files_limit", "32768")
+
 zookeeper_quorum_hosts = ','.join(ams_collector_hosts) if is_hbase_distributed else 'localhost'
 
 ams_checkpoint_dir = config['configurations']['ams-site']['timeline.metrics.aggregator.checkpoint.dir']

+ 2 - 0
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py

@@ -44,3 +44,5 @@ hbase_cmd = "/usr/lib/ams-hbase/bin/hbase"
 
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 hbase_conf_dir = "/etc/ams-hbase/conf"
+
+limits_conf_dir = "/etc/security/limits.d"

+ 35 - 0
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/ams.conf.j2

@@ -0,0 +1,35 @@
+{#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#}
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{ams_user}}   - nofile {{max_open_files_limit}}
+{{ams_user}}   - nproc  65536