How to enable jmx monitoring for 6.4.0 EAP
pkgudipati Jul 12, 2018 3:56 PMHi,
We are able to see mbeans through jconsole of our local machines.
But how to enable jmx port so that remote machines(from the same network) can access my local mbeans?
Step 1:
I have tried the following jvm arguments.
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote=true"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9999"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
it gives following ClassNotFoundError for MBeanServerBuilderImpl.
Step 2:
Then, I skipped the folllowing JVM argument,
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
I am getting the following LogManager error.
Step 3:
I have googled and found that to initialize the LogManager, I need to define LogManager class in jvm arguments and also define its classpath.
So, I added the following jvm arguments.
set "JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
set "JAVA_OPTS=%JAVA_OPTS% -Xbootclasspath/p:C:\Imp\JBOSS\jboss-eap-6.4.0\jboss-eap-6.4\modules\system\layers\base\org\jboss\logmanager\main\jboss-logmanager-1.5.4.Final-redhat-1.jar"
Now, I am successfully able to start the JBOSS server.
I can also access the mbeans from my local jconsole, but remote machines cannot access my mbeans which are exposed.
I am trying the following URL from a remote machine which is on the same network.
"service:jmx:rmi:///jndi/rmi://myHostName:9050/jmxrmi"
I am getting the following error.
com.pega.jmx.ui.util.JMXClientException: Cannot connect to the server with specified settings
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: lgudipwin; nested exception is: java.net.ConnectException: Connection refused: connect]
Please let me know If I am missing something.