Accessing JMX with jconsole over SSL on EAP 7.0
I am trying to configure secure JMX access similar to the following knowledge base article which applies to EAP 6.0
https://access.redhat.com/solutions/632773
EAP 7.0 has changed the default ports that are accessed.
I was successful in a standalone mode. However I have been unable to figure out how to get it work for domain mode.
In standalone I connected using jconsole using the service url - service:jmx:remote+https::
I would assume in domain mode I should be able connect to a similar service url such as service:jmx:remote+https::
where https port is the server https port 8443
Responses
Hi David,
I'm actually writing a procedure for a new guide that includes connections to remote EAP 7.0 using JConsole (albeit without SSL).
If you are using the Application Realm, you will also need to create a user in the application realm to use for authentication.
The JMX service URL for a managed domain is different for EAP 7.0 compared to EAP 6. Try using service:jmx:remote://IP_ADDRESS:PORT. For non-SSL, the port is 9999 for a managed domain host controller when setting the management endpoint to false.
Hi David, I've just tested it myself, and I think I have it working. I'll try and quickly detail the process I used below.
On the host:
- Create the keystore on the host, eg. and export the certificate.
keytool -genkey -alias jboss -keyalg RSA -keystore eap7console.jks -storepass changeit
keytool -exportcert -keystore eap7console.jks -alias jboss -keypass changeit -storepass changeit -file jboss.cer
Create a new user in the ApplicationRealm that you will use to connect to the JBoss EAP servers for remote monitoring.
Set the remoting management endpoint to false:
/profile=full/subsystem=jmx/remoting-connector=jmx:add(use-management-endpoint=false)
- Add the remoting port to the socket binding group.
/socket-binding-group=full-sockets/socket-binding=remoting:add(port=4447)
- Set the remoting subsystem to use the ApplicationRealm:
/profile=full/subsystem=remoting/connector=remoting-connector:add(socket-binding=remoting,security-realm=ApplicationRealm)
- Alter the security-realm to add SSL.
/host=master/core-service=management/security-realm=ApplicationRealm/server-identity=ssl:add(protocol=TLSv1,keystore-path=eap7console.jks,keystore-relative-to=jboss.domain.config.dir,keystore-password=changeit,alias=jboss)
- Start the host and bind to the IP address. You shouldn't see any errors on startup.
domain.sh -b 192.168.1.230
- On your client, import the certificate from the host to the client's truststore. e.g.
keytool -importcert -keystore clientkeystore.jks -storepass changeit -alias jboss -trustcacerts -file jboss.cer
- Start jconsole on your client (it's best to use the wrapper script in an EAP installation), pointing to the client's truststore:
./jconsole.sh -J-Djavax.net.ssl.trustStorePassword=changeit -J-Djavax.net.ssl.trustStore=/path/to/clientkeystore.jks
- Use the following URL for the remote process (it doesn't need '+https' for SSL to work), and use the username and password of the ApplicationRealm user you created earlier:
service:jmx:remote://HOST_IP_ADDRESS:4447
port 4447 corresponds to a server running on the host with a 0 port offset. To connect to other servers, add their port offset value to 4447.
I hope this helps :)
Hi David,
I'm glad you have it working how you like it. I'm definitely no expert in this area, so I can't confirm whether this is a 'correct' approach or not.
If you would like a more definitive answer and advice, I would suggest opening a support case so our support engineers can have a close look.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
