How to access JMX interface in docker from outside?

前端 未结 5 1134
情深已故
情深已故 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:14

    For dev environment you can set java.rmi.server.hostname to the catch-all IP address 0.0.0.0

    Example:

     -Djava.rmi.server.hostname=0.0.0.0 \
                    -Dcom.sun.management.jmxremote \
                    -Dcom.sun.management.jmxremote.port=${JMX_PORT} \
                    -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \
                    -Dcom.sun.management.jmxremote.local.only=false \
                    -Dcom.sun.management.jmxremote.authenticate=false \
                    -Dcom.sun.management.jmxremote.ssl=false
    

提交回复
热议问题