jmxtrans+InfluxDb+Grafana
参考:
jmxtrans+InfluxDb+Grafana部署:
https://www.jianshu.com/p/ac30f06d433f GG
jmx:
http://www.jmxtrans.org/
jmxtrans监控kafka参数:
https://www.sohu.com/a/166756065_610730
kafka jmx端口
https://www.cnblogs.com/30go/p/9274124.html
JMX最常见的场景是监控Java程序的基本信息和运行情况,任何Java程序都可以开启JMX,然后使用JConsole或Visual VM进行预览
#jmx中的参数说明:
https://kaimingwan.com/post/framworks/kafka/kafka0.10.xjian-kong-xiang-fen-xi GG
kafka的jmx配置:
https://www.iteye.com/blog/liumayulingyan-2047229
要打开rmi参数,jconsole才能远程连接上kafka jmx
https://my.oschina.net/mutianya/blog/183899
vim /data/kafka_2.11-2.3.1-19092/bin/kafka-run-class.sh
# JMX settings
if [ -z "$KAFKA_JMX_OPTS" ]; then
KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=外网ip -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
fi
# JMX port to use
if [ $JMX_PORT ]; then
KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
fi
jconsole连接见:
https://www.cnblogs.com/hongfeng2019/p/12380095.html
#jmxtrans安装:
官网:
https://github.com/jmxtrans/jmxtrans/wiki/Installation
wget http://central.maven.org/maven2/org/jmxtrans/jmxtrans/266/jmxtrans-266.rpm
rpm -ivh jmxtrans-266.rpm ##安装
/etc/init.d/jmxtrans start ##启动
vim /etc/jmxtrans/wrapper.conf
您需要监视的JVM越多,可能需要的内存就越多
# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3
wrapper.java.initmemory=64
# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64
wrapper.java.maxmemory=2048
该应用程序安装在: /usr/share/jmxtrans
配置选项存储在: /etc/jmxtrans/wrapper.conf
在以下位置有一个初始化脚本: /etc/init.d/jmxtrans
将您的.json文件放入: /var/lib/jmxtrans
#采集的写法
https://github.com/jmxtrans/jmxtrans/wiki/Queries
#后端output to influxdb写法:
https://github.com/jmxtrans/jmxtrans/wiki/InfluxDBWriter