本次使用javaagent-0.16.0版本
监控hbase基于ambari
下载链接:https://github.com/prometheus/jmx_exporter/releases
2、jar包放到集群中hbase启动的lib目录下/usr/hdp/3.1.4.0-315/hbase/lib下
3、配置所有节点加上JMX exporter的agent,此处用的是ambari,故在页面添加hbase-env ##对每个节点 export Hbase_JMX_base="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" ##对master节点,此处端口号是27000 export Hbase_MASTER_OPTS="$Hbase_MASTER_OPTS $Hbase_JMX_base -Dcom.sun.management.jmxremote.port=20101 -javaagent:$Hbase_HOME/lib/jmx_prometheus_javaagent-0.16.0.jar=27000:$Hbase_HOME/conf/hbase_jmx_config.yaml" ##对RS节点,此处端口号是27001 export Hbase_REGIONSERVER_OPTS="$Hbase_REGIONSERVER_OPTS $Hbase_JMX_base -Dcom.sun.management.jmxremote.port=20102 -javaagent:$Hbase_HOME/lib/jmx_prometheus_javaagent-0.16.0.jar=27001:$Hbase_HOME/conf/hbase_jmx_config.yaml"4、创建hbase_jmx_config.yaml,在conf目录下
--- lowercaseOutputName: true lowercaseOutputLabelNames: true rules: - pattern: Hadoop5、重启hbase程序 6、查看监控项metrics<>Namespace_([^W_]+)_table_([^W_]+)_region_([^W_]+)_metric_(w+) name: Hbase_metric_$4 labels: namespace: "$1" table: "$2" region: "$3" - pattern: Hadoop <>([w._]+) name: hadoop_$1_$4 labels: "name": "$2" "sub": "$3" - pattern: .+
http://192.168.85.103:27001/metrics
- job_name: "hbase" static_configs: - targets: ["192.168.85.103:27001"]2)重启prometheus
nohup ./prometheus --config.file=prometheus.yml &3)页面访问
http://192.168.85.102:9090/
8、对接grafana模板可以从下面链接下载
https://grafana.com/grafana/dashboards/
yum install grafana-enterprise-8.3.4-1.x86_64.rpm
https://grafana.com/grafana/dashboards/
此处下载2.x模板
grafana页面导入模板
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)