性能测试

web应用jvm监控 jmx_exporter prometh

2020-03-15  本文已影响0人  杰罗米诺大背头

组件职责:

jmx_exporter :指定端口开启一个独立进程,负载后台收集应用程序jvm数据

prometheus :配置一个指定job专门负责对指定端口的jmx_exporter监控进程

做数据的转换,具体转换成grafana程序需要的接口数据

grafana :负责在界面中渲染prometheus 提供的数据源

1.jmx_exporter docker制作

```

docker run -d -p 9001:8080 -p 9995:9995 -p 9200:9200

--name 7dgroup-tomcat-skywalking-jmxexporter -v

/packages/tomcat/blog/ROOT/:/apache-tomcat-8.5.9/webapps/ROOT/ -v

/packages/tomcat/blog/logs:/apache-tomcat-8.5.9/logs:rw -e

CATALINA_OPTS="-Dcom.sun.management.jmxremote

-Dcom.sun.management.jmxremote.port=9995

-Djava.rmi.server.hostname=49.232.175.137

-Dcom.sun.management.jmxremote.ssl=false

-Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.rmi.port=9995" 9ce0273b8882

```

```

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=49.232.175.137 -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

CATALINA_OPTS="$CATALINA_OPTS

-javaagent:/apache-tomcat-8.5.9/bin/agent/skywalking-agent.jar

-javaagent:/apache-tomcat-8.5.9/bin/jmx_exporter/jmx_prometheus_javaagent-0.3.1.jar=9200:/apache-tomcat-8.5.9/bin/jmx_exporter/jmx-exporter-config.yml"

```

2.1:prometheus :配置一个指定job

- job_name: 'app_java1'

    static_configs:

    - targets: ['49.232.175.137:9200']

2.2 启动prometheus

nohup ./prometheus --config.file=prometheus.yml &

3.1 grafana 连接prometheus 数据源并指定dashboad模板

上一篇 下一篇

猜你喜欢

热点阅读