How to access JMX interface in docker from outside?

前端 未结 5 1128
情深已故
情深已故 2020-12-02 07:54

I am trying to remotely monitor a JVM running in docker. The configuration looks like this:

  • machine 1: runs a JVM (in my case, running kafka) in docker on

5条回答
  •  醉酒成梦
    2020-12-02 08:27

    After digging around for quite a lot, I found this configuration

    -Dcom.sun.management.jmxremote.ssl=false 
    -Dcom.sun.management.jmxremote.authenticate=false 
    -Dcom.sun.management.jmxremote.port=1098
    -Dcom.sun.management.jmxremote.rmi.port=1098
    -Djava.rmi.server.hostname=localhost
    -Dcom.sun.management.jmxremote.local.only=false
    

    The difference with the other above is that java.rmi.server.hostname is set to localhost instead of 0.0.0.0

提交回复
热议问题