Repository: ambari
Updated Branches:
  refs/heads/branch-metrics-dev a3b821e3f -> 43460193b


AMBARI-8453. Configure AMS metrics to be stored in its own storage layer. 
(swagle)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43460193
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43460193
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43460193

Branch: refs/heads/branch-metrics-dev
Commit: 43460193b77a6adcbaa9fbc20d549783c2e15c9b
Parents: a3b821e
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Tue Nov 25 17:37:18 2014 -0800
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Tue Nov 25 17:37:18 2014 -0800

----------------------------------------------------------------------
 .../2.2/services/AMS/package/scripts/hbase.py   | 51 ++++++------------
 .../hadoop-metrics2-hbase.properties.j2         | 55 ++++++++++++++++++++
 2 files changed, 70 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/43460193/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
index cf221ec..c21ab4c 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
@@ -26,7 +26,7 @@ def hbase(name=None # 'master' or 'regionserver' or 'client'
               ):
   import params
 
-  Directory( params.hbase_conf_dir,
+  Directory(params.hbase_conf_dir,
       owner = params.hbase_user,
       group = params.user_group,
       recursive = True
@@ -44,7 +44,7 @@ def hbase(name=None # 'master' or 'regionserver' or 'client'
              recursive = True
   )
 
-  XmlConfig( "hbase-site.xml",
+  XmlConfig("hbase-site.xml",
             conf_dir = params.hbase_conf_dir,
             configurations = params.config['configurations']['ams-hbase-site'],
             
configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
@@ -52,24 +52,8 @@ def hbase(name=None # 'master' or 'regionserver' or 'client'
             group = params.user_group
   )
 
-  # XmlConfig( "hdfs-site.xml",
-  #           conf_dir = params.hbase_conf_dir,
-  #           configurations = params.config['configurations']['hdfs-site'],
-  #           
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
-  #           owner = params.hbase_user,
-  #           group = params.user_group
-  # )
-  #
-  # XmlConfig("hdfs-site.xml",
-  #           conf_dir=params.hadoop_conf_dir,
-  #           configurations=params.config['configurations']['hdfs-site'],
-  #           
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
-  #           owner=params.hdfs_user,
-  #           group=params.user_group
-  # )
-
   if 'ams-hbase-policy' in params.config['configurations']:
-    XmlConfig( "hbase-policy.xml",
+    XmlConfig("hbase-policy.xml",
             conf_dir = params.hbase_conf_dir,
             configurations = 
params.config['configurations']['ams-hbase-policy'],
             
configuration_attributes=params.config['configuration_attributes']['ams-hbase-policy'],
@@ -86,13 +70,20 @@ def hbase(name=None # 'master' or 'regionserver' or 'client'
   File(format("{hbase_conf_dir}/hbase-env.sh"),
        owner = params.hbase_user,
        content=InlineTemplate(params.hbase_env_sh_template)
-  )     
+  )
+
+  # Metrics properties
+  File(os.path.join(params.hbase_conf_dir, "hadoop-metrics2-hbase.properties"),
+         owner = params.hbase_user,
+         group = params.user_group,
+         content=Template("hadoop-metrics2-hbase.properties.j2")
+    )
        
   # hbase_TemplateConfig( params.metric_prop_file_name,
   #   tag = 'GANGLIA-MASTER' if name == 'master' else 'GANGLIA-RS'
   # )
 
-  hbase_TemplateConfig( 'regionservers')
+  hbase_TemplateConfig('regionservers')
 
   if params.security_enabled:
     hbase_TemplateConfig( format("hbase_{name}_jaas.conf"))
@@ -121,21 +112,9 @@ def hbase(name=None # 'master' or 'regionserver' or 
'client'
       group=params.user_group,
       owner=params.hbase_user
     )
-  # if name in ["master","regionserver"]:
-  #   params.HdfsDirectory(params.hbase_hdfs_root_dir,
-  #                        action="create_delayed",
-  #                        owner=params.hbase_user
-  #   )
-  #   params.HdfsDirectory(params.hbase_staging_dir,
-  #                        action="create_delayed",
-  #                        owner=params.hbase_user,
-  #                        mode=0711
-  #   )
-  #   params.HdfsDirectory(None, action="create")
-
-def hbase_TemplateConfig(name, 
-                         tag=None
-                         ):
+
+
+def hbase_TemplateConfig(name, tag=None):
   import params
 
   TemplateConfig( format("{hbase_conf_dir}/{name}"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/43460193/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
new file mode 100644
index 0000000..8dc4bea
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
@@ -0,0 +1,55 @@
+{#
+# 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.
+
+# syntax: [prefix].[source|sink|jmx].[instance].[options]
+# See package.html for org.apache.hadoop.metrics2 for details
+
+# HBase-specific configuration to reset long-running stats (e.g. compactions)
+# If this variable is left out, then the default is no expiration.
+hbase.extendedperiod = 3600
+
+hbase.class=org.apache.hadoop.metrics2.sink.timeline.TimelineMetricsSink
+hbase.period=10
+hbase.collector={{ams_collector_host_single}}:8188
+
+jvm.class=org.apache.hadoop.metrics2.sink.timeline.TimelineMetricsSink
+jvm.period=10
+jvm.collector={{ams_collector_host_single}}:8188
+
+rpc.class=org.apache.hadoop.metrics2.sink.timeline.TimelineMetricsSink
+rpc.period=10
+rpc.collector={{ams_collector_host_single}}:8188
+
+hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.TimelineMetricsSink
+hbase.sink.timeline.period=10
+hbase.sink.timeline.collector={{ams_collector_host_single}}:8188

Reply via email to