Steps for remote JMX monitoring using JvisualVM for JBOSS 7.
Approach 1
= = = = =
1). Create Management user using following command:-
$JBOSS_HOME/bin/add-user.sh -a <username> <password>
2). Locate "<subsystem xmlns="urn:jboss:domain:jmx:1.1">" in standalone.xml file from $JBOSS_HOME/standalone/configuration folder.
3). Replace <remoting-connector/> line with <remoting-connector use-management-endpoint="true"/>.
4) Save standalone.xml file.
5). Open Command console.
6). Run environment script.
7). Go to $JBOSS_HOME/bin folder.
8) Start JBoss server using the following command:
./standalone.sh -Djboss.bind.address.management=<ip address>
9). Copy jboss-client-7.1.0.Final.jar from $JBOSS_HOME/bin/client directory to $JAVA_HOME/lib directory. (Here JAVA_HOME is on the machine where you want to run jvisualvm).
10). Open command console from the machine where you want to run jvisualvm.
11). Go to $JAVA_HOME/bin location.
12). Execute the following command:
jvisualvm --cp:a $JAVA_HOME \lib\jboss-client-7.1.0.Final.jar
13). Double-click or right-click to add the host name. After adding the host name, you need to add JMX connection. Type the following URL in the Connection field:
service:jmx:remoting-jmx://<machine ip>:9999
Example:
service:jmx:remoting-jmx://10.97.108.72:9999.
In this case, 9999 is the JMXport for the TIBCO MDM Server on 10.97.108.72.
Approach 2
= = = = =
Enabling Remote JMX Monitoring on JBoss 7 Application Server (way 2)
1). Open file %JBOSS_HOME%\bin\standalone.conf.bat :
Go to end of file and add the following line before JAVA_OPTS_SET
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=1090 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:%JBOSS_HOME%/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar -Xbootclasspath/p:%JBOSS_HOME%/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar -Xbootclasspath/p:%JBOSS_HOME%/modules/org/apache/log4j/main/log4j-1.2.16.jar -Djboss.modules.system.pkgs=org.jboss.logmanager"
2). Go to the machine from where you want to run Java VisualVM.
Open command promt.
Go to %JAVA_HOME%\bin and run command as :
jvisualvm.exe
The Java VisualVM dialog box is displayed with the Local and Remote options.
Right click on Remote -> Add Remote Host -> provide Host Name (IP address of machine where JBOSS is installed) -> Click on ok. Host is added below Remote.
Right click on newly added Host -> Add JMX Connection ... -> Provide connection URL as <hostname>:<port>
For example : 10.97.108.84:1090
Click on ok.
Connection is successful.
Click on <hostmane>:<port> which is below Remote -> Hostname. JMX window is opened in right side.