Separated JMX_BINDING from JMX_HOST in ENABLE_JMX usage

This commit is contained in:
Geoff Bourne 2021-02-20 17:34:00 -06:00
parent c056b9d2dd
commit d47c801b18
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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