prometheus监控tomcat
下载tomcat,wget **;解压tar zxvf **;
下载jmx_exporter,
wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar
配置文件config.yaml
将*.jar包和config.yaml均放到tomcat目录/bin中
修改tomcat目录/bin/catalina.sh,找到JAVA_OPTS添加
JAVA_OPTS="-javaagent:/usr/local/apache-tomcat-7.0.96/bin/jmx_prometheus_javaagent-0.12.0.jar=30013:/usr/local/apache-tomcat-7.0.96/bin/config.yaml"
启动tomcat(./startup.sh),浏览器访问ip:/30013/ 或则shell下(即centos下)访问curl http://ip:30013/
配置prometheus
启动prometheus (systemctl start prometheus)
启动grafana,访问ip:3000 import 模板(java的模板8563)
导入成功后,直接跳转到上图,显示监控结果;
越努力,越幸运!!!
good good study,day day up!!!