zeppelin监控:Prometheus Monitoring和JMX Monitoring
官方文档地址:
https://zeppelin.apache.org/docs/0.9.0/setup/operation/monitoring.html
zeppelin监控有两种实现方式:
- 方式一:Prometheus Monitoring
- 方式二:JMX Monitoring
一、Prometheus Monitoring
- Prometheus Monitoring
Prometheus is the leading monitoring solution for Kubernetes. The Prometheus endpoint can be activated with the configuration property zeppelin.metric.enable.prometheus. The metrics are accessible via the unauthenticated endpoint /metrics. - zeppelin-site.xml中增加prometheus监控配置
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- 服务端口。默认为8080,如果已占用,可以修改之 -->
<property>
<name>zeppelin.server.port</name>
<value>19090</value>
<description>Server port.</description>
</property>
<!-- Zeppelin Monitoring -->
<property>
<name>zeppelin.metric.enable.prometheus</name>
<value>true</value>
<description>Anonymous user allowed by default</description>
</property>
</configuration>
二、浏览器查看Prometheus Monitoring输出的zeppelin监控指标
- 服务器IP地址+端口号+metrics查看zeppelin metrics,端口号是zeppelin对外服务端口号。例如:ip:19090/metrics
三、JMX Monitoring
- JMX is a general solution for monitoring Java applications. JMX can be activated with the configuration property zeppelin.jmx.enable. The default port 9996 can be changed with the configuration property zeppelin.jmx.port.
- 需要zeppelin环境中打开JMX端口号
- 需要安装JMX导出器才能查看JMX指标
export ZEPPELIN_JMX_ENABLE=true
export ZEPPELIN_JMX_PORT=9996
四、安装JMX导出器
安装JMX导出器监控JMX指标可以我的这篇监控debezium指标的做法:
- 安装jmx导出器监控debezium指标
- 首先安装jmx导出器
- 再创建jmx导出zeppelin的配置文件
- 将jmx导出器添加到zeppelin启动环境中
安装JMX导出器步骤如下:
mkdir -p /opt/jmx/
cd /opt/jmx/
wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar
mv jmx_prometheus_javaagent-0.16.1.jar jmx-exporter.jar