diff --git a/README.md b/README.md index 8a94d9fb..e2f55197 100644 --- a/README.md +++ b/README.md @@ -1150,9 +1150,11 @@ For some cases, if e.g. after removing mods, it could be necessary to startup mi ### Enable Remote JMX for Profiling -To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true` and add a port forwarding of TCP port 7091, such as: +To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true`, set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as: - -e ENABLE_JMX=true -p 7091:7091 +``` +-e ENABLE_JMX=true -e JMX_HOST=$HOSTNAME -p 7091:7091 +``` ### Enable Aikar's Flags diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 7b227e12..0e8fb9d3 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -84,7 +84,6 @@ if [ -n "$JVM_DD_OPTS" ]; then fi if isTrue ${ENABLE_JMX}; then - : ${JMX_HOST:=0.0.0.0} : ${JMX_PORT:=7091} JVM_OPTS="${JVM_OPTS} -Dcom.sun.management.jmxremote.local.only=false @@ -92,8 +91,8 @@ if isTrue ${ENABLE_JMX}; then -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false - -Dcom.sun.management.jmxremote.host=${JMX_HOST} - -Djava.rmi.server.hostname=${JMX_HOST}" + -Dcom.sun.management.jmxremote.host=${JMX_BINDING:-0.0.0.0} + -Djava.rmi.server.hostname=${JMX_HOST:-localhost}" log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}" fi