Azkaban JMX监控 jmx exporter实用技能

Azkaban JMX监控

最近在排查Azkaban的问题,发现Azkaban自身做了JMX指标的,本文直接提供Docker版本的Azkaban JMXExporter教程。

这里在Github上找到了三个项目:
https://github.com/sinsengumi/azkaban-jmx-exporter
https://github.com/WillCup/jmx_exporter
https://github.com/runningdata/jmxexporters

通过这三个项目,可以做出一个Azkaban的JmxExporter的Docker版本。

构建镜像:

※这里 build-arg十分重要,如果服务器上是通过代理访问网络的,那么git代理是走HTTPS_PROXY,maven这里通过JVM参数的配置。

#!/bin/sh
docker build -t slankka/azkaban_exporter:v3 --rm=true \
 --build-arg HTTPS_PROXY=$https_proxy \
 --build-arg HTTP_PROXY=$http_proxy \
 --build-arg MAVEN_OPTS="-Dmaven.wagon.rto=3000 -Dhttps.proxyHost=<slankka-host> -Dhttps.proxyPort=<slankka-port> -Dhttp.proxyHost=<slankka-host> -Dhttp.proxyPort=<slankka-port>" \
 .

Entrypoint.sh

这里直接使用runningdata/jmxexporters提供的entrypoint,本文这里增加JVM_OPTS作为环境变量(重要)。

Tips

※也可直接从环境变量中获取这些参数。
※这里jmx_prometheus_httpserver.jar的参数定义,在https://github.com/WillCup/jmx_exporter。

#! /bin/bash
if [ $# != 4 ]; then
    echo "Usage entrypoint.sh <hostPort> <http_port> <srv_type> <instance_name>"
exit 0
fi

HOST_PORT=$1
HTTP_PORT=$2
SRV_TYPE=$3
INSTANCE_NAME=$4

METRIC_FILE=/${SRV_TYPE}.yml

echo "hostPort: ${HOST_PORT}" >> ${METRIC_FILE}
echo "instanceName: ${INSTANCE_NAME}" >> ${METRIC_FILE}
echo "http port is ${HTTP_PORT}, target host port is ${HOST_PORT}"
java ${JVM_OPTS} -jar /jmx_prometheus_httpserver.jar ${HTTP_PORT} ${METRIC_FILE}

部署

Azkaban的web和executor 均提供了JMX的端口,HOST_PORT就是Azakaban的IP加上JMX PORT。

posted @   一杯半盏  阅读(742)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2020-12-22 关于同一个JVM连接多个加密方式不同的Zookeeper的讨论
点击右上角即可分享
微信分享提示