How to access Spring-boot JMX remotely

前端 未结 3 543
礼貌的吻别
礼貌的吻别 2020-11-30 23:00

I know that spring automatically expose JMX beans. I was able to access it locally using VisualVM.

However on prod how I can connect to remotely to the app using it\

3条回答
  •  没有蜡笔的小新
    2020-11-30 23:29

    Add the following JVM Properties in "$JAVA_OPTS" (in your application):

    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port= -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=
    

    In the Jconsole/Visual VM use the following to connect:

    service:jmx:rmi:///jndi/rmi://:/jmxrmi
    

    It doesn't enable security, but will help you to connect to the remote server.

提交回复
热议问题