JConsole remote connection to JBoss EAP

核能气质少年 提交于 2021-02-18 06:48:11

问题


I am trying to connect to a remote jboss instance running on a server. I am using the following connection URL

service:jmx:remoting-jmx://90.214.64.170:9999

When i do this i get the following 2 errors in the console window

enter image description here

After selecting insecure i am presented with this

enter image description here

I have, prior to connecting via jconsole also gone to the bin directory of my jboss server and run ./jconsole.sh which outputs the following to the command line

CLASSPATH /usr/bin/java/jdk1.8.0_11/lib/jconsole.jar:/usr/bin/java/jdk1.8.0_11/lib/tools.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/remoting-jmx/main/remoting-jmx-1.1.2.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/remoting3/main/jboss-remoting-3.2.18.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/xnio/main/xnio-api-3.0.7.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/xnio/nio/main/xnio-nio-3.0.7.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/sasl/main/jboss-sasl-1.0.3.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/marshalling/main/jboss-marshalling-1.4.2.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/marshalling/river/main/jboss-marshalling-river-1.4.2.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/as/cli/main/jboss-as-cli-7.3.0.Final-redhat-14.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/staxmapper/main/staxmapper-1.1.0.Final-redhat-2.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/as/protocol/main/jboss-as-protocol-7.3.0.Final-redhat-14.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/dmr/main/jboss-dmr-1.2.0.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/as/controller-client/main/jboss-as-controller-client-7.3.0.Final-redhat-14.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/threads/main/jboss-threads-2.1.1.Final-redhat-1.jar

I am not sure what else i can try (having also opened port 9999) to get this to work, does anyone have any advice or hints that might help resolve this?

Thanks

EDIT

Having modified my standalone.conf file to this

#
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
   JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
   JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
   JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
   JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9999"
   JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
   JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
else
   echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi

I am still unable to connect - with the same errors as above


回答1:


Follow the instructions mentioned below to enable remote JMX monitoring in JBoss

JBoss 4.2.3.GA

Modify run.conf file available in bin directory of JBoss and add below lines-

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

JBoss 5.1.0.GA

JMX port cannot be configured in JBoss 5.1 due to an existing bug (https://issues.jboss.org/browse/JBAS-6185) in JBoss which has been fixed in JBoss 6.0 version.

JBoss 6.1.0.Final

Modify run.conf file available in bin directory of JBoss and add below lines-

JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_ARGS="$JAVA_OPTS -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"
JBOSS_CLASSPATH="../lib/jboss-logmanager.jar"

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<IP_ADDRESS>"

JBoss 7.1.1.Final

Modify standalone.conf file available in bin directory of JBoss and add below lines-

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<IP_ADDRESS>"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:../modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar  -Xbootclasspath/p:../modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar -Xbootclasspath/p:../modules/org/apache/log4j/main/log4j-1.2.16.jar"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.logmanager"

NOTE: Modify and according to your requirements.

Reference:

https://community.jboss.org/wiki/JBossMBeansInJConsole

http://abh1sh3k.blogspot.in/2013/12/jmx-configuration-in-different-versions.html




回答2:


I have found the answer - well at least a solution.

Having read through the new JBOSS release notes herefor EAP 6.3 I found the following;

Restored ServiceMBean Helper Classes The org.jboss.as.system-jmx module has been introduced to restore helper classes available in earlier versions of JBoss EAP that assist users in creating MBeans.

What we did was deploy a new standalone instance - clean install of 6.3 and then followed this guide;

https://planet.jboss.org/post/jmx_connections_to_jboss_as

We needed no optional parameters to be added, no modifications to standalone.sh and no modifications for standalone.xml.

I see someone has 5 up votes for an incorrect answer - is this just so the bounty is awarded?!




回答3:


Ok... This was really an issue for me and is important for you to know that if you jave JConsole and JBoss on different machines, the JConsole that comes with Java DOES NOT WORK... You have to download a copy of JBoss on the machine you have JConsole and on the bin folder look for the jconsole.bat file.

I took it from here: http://www.java-redefined.com/2014/02/jboss-7-with-jconsole.html




回答4:


I believe for remote connections you have to create an Application Realm user (Using add-user.sh. I answered yes to the question as to whether this would be used for remote server connections or EJB remoting user, though I'm unsure that was strictly necessary).

Then use those credentials to connect with jconsole.

My experience with this also is isolated to remote connections to EAP 6.2.4 running in domain mode. I can only hope remote connections to a standalone server would be the same. It's unclear which you're using here.

I also changed it so I could use port 4447 by issuing this command in the CLI: /profile=ha/subsystem=jmx/remoting-connector=jmx:add(use-management-endpoint=false)

And it doesn't apply to your issue as it appears you're using JDK 8, but I believe JDK 7 or higher is required (for jconsole).

Hope something here helps!




回答5:


JBoss 6.2.0 EAP

To use JConsole with JBoss 6.2 EAP you must start it adding some JARs to the classpath.

In the directory /jboss-eap-6.2/bin/client there is a README file that says:

TO RUN JCONSOLE:

jconsole -J-Djava.class.path=<PATH TO jconsole.jar>;<PATH TO tools.jar>;<PATH TO jboss-cli-client.jar>



回答6:


For version 6.1, Make sure you have added the correct portoffset to your default portnumber, 9999 is default, so remote process should work with:

service:jmx:remoting-jmx://90.214.64.170:(offsetnumber+9999)

Apparently, this got resolved in version 6.2



来源:https://stackoverflow.com/questions/25046317/jconsole-remote-connection-to-jboss-eap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!