sreekesh.s
sreekesh.s

Reputation: 159

Jconsole not connecting with jmx port of Keycloak

I tried to enable jmx to check on cache statistics, I tried to do this in local setup with following command

docker run -it --rm --name keycloak
--cap-add SYS_ADMIN
-p 8080:8080
-p 8787:8787
-p 8999:8999
-e KEYCLOAK_ADMIN="keycloak"
-e KEYCLOAK_ADMIN_PASSWORD="keycloak"
-e DEBUG="true"
-e DEBUG_PORT="*:8787"
-e JAVA_OPTS_APPEND="-Xmx1g
-Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.rmi.port=8999
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname="$(hostname)"
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/keycloak.hprof"
quay.io/keycloak/keycloak:17.0.0 start-dev
--log-level=INFO

Jmx is enabled but not getting connected from jconsole

Upvotes: 1

Views: 769

Answers (1)

csbrogi
csbrogi

Reputation: 529

You should take a look in the log-files. Are there error messages or can you see, wheter the ARGS reach the startup process?

I had some trouble to add the JMX Options on keycloak-16, the ser failed to start afterward. Then I found this article. This works for me. If you run the docker image on a remote host, you can copy the jboss-cli-client.jar to your local maschine. And after each startof the container you have to add the user again.

Upvotes: 0

Related Questions