Selaa lähdekoodia

AMBARI-2881. Enable HBase 96 metrics in a backward compatible way with HBase 94.

Mahadev Konar 11 vuotta sitten
vanhempi
commit
be99d85a7b

+ 2 - 2
ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/init.pp

@@ -106,7 +106,7 @@ class hdp-hbase(
       override_owner => true
     }
 
-   hdp-hbase::configfile { ['hbase-env.sh','hadoop-metrics.properties']: 
+   hdp-hbase::configfile { ['hbase-env.sh',  $hdp-hbase::params::metric-prop-file-name ]: 
       type => $type
     }
 
@@ -135,7 +135,7 @@ define hdp-hbase::configfile(
   $conf_dir = $hdp-hbase::params::conf_dir
 ) 
 {
-  if ($name == 'hadoop-metrics.properties') {
+  if ($name == $hdp-hbase::params::metric-prop-file-name) {
     if ($type == 'master') {
       $tag = GANGLIA-MASTER
     } else {

+ 1 - 1
ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/master.pp

@@ -61,6 +61,6 @@ class hdp-hbase::master(
 #assumes that master and regionserver will not be on same machine
 class hdp-hbase::master::enable-ganglia()
 {
-  Hdp-hbase::Configfile<|title  == 'hadoop-metrics.properties'|>{template_tag => 'GANGLIA-MASTER'}
+  Hdp-hbase::Configfile<|title  == $metric-prop-file-name |>{template_tag => 'GANGLIA-MASTER'}
 }
 

+ 5 - 0
ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/params.pp

@@ -103,5 +103,10 @@ class hdp-hbase::params() inherits hdp::params
     $hbase_regionserver_jaas_princ = "${hbase_regionserver_primary_name}@${kerberos_domain}"
   }
 
+  if (hdp_get_major_stack_version($hdp::params::stack_version) >= 2) {
+    $metric-prop-file-name = "hadoop-metrics2-hbase.properties"
+  } else {
+    $metric-prop-file-name = "hadoop-metrics.properties"
+  }
   $smokeuser_permissions = hdp_default("smokeuser_permissions", "RWXCA")
 }

+ 1 - 1
ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/regionserver.pp

@@ -69,5 +69,5 @@ class hdp-hbase::regionserver(
 #assumes that master and regionserver will not be on same machine
 class hdp-hbase::regionserver::enable-ganglia()
 {
-  Hdp-hbase::Configfile<|title  == 'hadoop-metrics.properties'|>{template_tag => 'GANGLIA-RS'}
+  Hdp-hbase::Configfile<|title  == $metric-prop-file-name |>{template_tag => 'GANGLIA-RS'}
 }

+ 62 - 0
ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.erb

@@ -0,0 +1,62 @@
+# 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.
+
+# See http://wiki.apache.org/hadoop/GangliaMetrics
+#
+# Make sure you know whether you are using ganglia 3.0 or 3.1.
+# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
+# And, yes, this file is named hadoop-metrics.properties rather than
+# hbase-metrics.properties because we're leveraging the hadoop metrics
+# package and hadoop-metrics.properties is an hardcoded-name, at least
+# for the moment.
+#
+# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
+
+# 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
+
+# Configuration of the "hbase" context for ganglia
+# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
+# hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext
+hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
+hbase.period=10
+hbase.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8663
+
+# Configuration of the "jvm" context for ganglia
+# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
+# jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext
+jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
+jvm.period=10
+jvm.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8663
+
+# Configuration of the "rpc" context for ganglia
+# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
+# rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext
+rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
+rpc.period=10
+rpc.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8663
+
+#Ganglia following hadoop example
+hbase.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
+hbase.sink.ganglia.period=10
+
+# default for supportsparse is false
+*.sink.ganglia.supportsparse=true
+
+.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
+.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
+
+hbase.sink.ganglia.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8663

+ 62 - 0
ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.erb

@@ -0,0 +1,62 @@
+# 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.
+
+# See http://wiki.apache.org/hadoop/GangliaMetrics
+#
+# Make sure you know whether you are using ganglia 3.0 or 3.1.
+# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
+# And, yes, this file is named hadoop-metrics.properties rather than
+# hbase-metrics.properties because we're leveraging the hadoop metrics
+# package and hadoop-metrics.properties is an hardcoded-name, at least
+# for the moment.
+#
+# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
+
+# 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
+
+# Configuration of the "hbase" context for ganglia
+# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
+# hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext
+hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
+hbase.period=10
+hbase.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8660
+
+# Configuration of the "jvm" context for ganglia
+# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
+# jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext
+jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
+jvm.period=10
+jvm.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8660
+
+# Configuration of the "rpc" context for ganglia
+# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
+# rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext
+rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
+rpc.period=10
+rpc.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8660
+
+#Ganglia following hadoop example
+hbase.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
+hbase.sink.ganglia.period=10
+
+# default for supportsparse is false
+*.sink.ganglia.supportsparse=true
+
+.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
+.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
+
+hbase.sink.ganglia.servers=<%=scope.function_hdp_host("ganglia_server_host")%>:8660

+ 16 - 16
ambari-server/src/main/resources/ganglia_properties_2.json

@@ -7444,12 +7444,12 @@
         "temporal":true
       },
       "metrics/hbase/master/cluster_requests":{
-        "metric":"hbase.master.cluster_requests",
+        "metric":"master.Server.clusterRequests",
         "pointInTime":false,
         "temporal":true
       },
       "metrics/hbase/master/splitSize_avg_time":{
-        "metric":"hbase.master.splitSize_avg_time",
+        "metric":"master.Server.HlogSplitSize_mean",
         "pointInTime":true,
         "temporal":true
       },
@@ -7459,7 +7459,7 @@
         "temporal":true
       },
       "metrics/hbase/master/splitTime_avg_time":{
-        "metric":"hbase.master.splitTime_avg_time",
+        "metric":"master.Server.HlogSplitTime_mean",
         "pointInTime":true,
         "temporal":true
       },
@@ -10107,7 +10107,7 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/compactionQueueSize":{
-        "metric":"hbase.regionserver.compactionQueueSize",
+        "metric":"regionserver.Server.compactionQueueLength",
         "pointInTime":true,
         "temporal":true
       },
@@ -10177,7 +10177,7 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/flushQueueSize":{
-        "metric":"hbase.regionserver.flushQueueSize",
+        "metric":"regionserver.Server.flushQueueLength",
         "pointInTime":true,
         "temporal":true
       },
@@ -10427,12 +10427,12 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/readRequestsCount":{
-        "metric":"hbase.regionserver.readRequestsCount",
+        "metric":"regionserver.Server.readRequestCount",
         "pointInTime":true,
         "temporal":true
       },
       "metrics/hbase/regionserver/regions":{
-        "metric":"hbase.regionserver.regions",
+        "metric":"regionserver.Server.regionCount",
         "pointInTime":true,
         "temporal":true
       },
@@ -10472,7 +10472,7 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/writeRequestsCount":{
-        "metric":"hbase.regionserver.writeRequestsCount",
+        "metric":"regionserver.Server.writeRequestCount",
         "pointInTime":true,
         "temporal":true
       },
@@ -17303,12 +17303,12 @@
         "temporal":true
       },
       "metrics/hbase/master/cluster_requests":{
-        "metric":"hbase.master.cluster_requests",
+        "metric":"master.Server.clusterRequests",
         "pointInTime":false,
         "temporal":true
       },
       "metrics/hbase/master/splitSize_avg_time":{
-        "metric":"hbase.master.splitSize_avg_time",
+        "metric":"master.Server.HlogSplitTime_mean",
         "pointInTime":true,
         "temporal":true
       },
@@ -17318,7 +17318,7 @@
         "temporal":true
       },
       "metrics/hbase/master/splitTime_avg_time":{
-        "metric":"hbase.master.splitTime_avg_time",
+        "metric": "master.Server.HlogSplitTime_mean",
         "pointInTime":true,
         "temporal":true
       },
@@ -19876,7 +19876,7 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/compactionQueueSize":{
-        "metric":"hbase.regionserver.compactionQueueSize",
+        "metric":"regionserver.Server.compactionQueueLength",
         "pointInTime":true,
         "temporal":true
       },
@@ -19946,7 +19946,7 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/flushQueueSize":{
-        "metric":"hbase.regionserver.flushQueueSize",
+        "metric":"regionserver.Server.flushQueueLength",
         "pointInTime":true,
         "temporal":true
       },
@@ -20196,12 +20196,12 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/readRequestsCount":{
-        "metric":"hbase.regionserver.readRequestsCount",
+        "metric":"regionserver.Server.readRequestCount",
         "pointInTime":true,
         "temporal":true
       },
       "metrics/hbase/regionserver/regions":{
-        "metric":"hbase.regionserver.regions",
+        "metric":"regionserver.Server.regionCount",
         "pointInTime":true,
         "temporal":true
       },
@@ -20241,7 +20241,7 @@
         "temporal":true
       },
       "metrics/hbase/regionserver/writeRequestsCount":{
-        "metric":"hbase.regionserver.writeRequestsCount",
+        "metric":"regionserver.Server.writeRequestCount",
         "pointInTime":true,
         "temporal":true
       },