Appendix C. Connecting with JConsole
C.1. Connect to JDG via JConsole
JConsole is a JMX GUI that allows a user to connect to a JVM, either local or remote, to monitor the JVM, its MBeans, and execute operations.
Add Management User to JBoss Data Grid
Before being able to connect to a remote JBoss Data Grid instance a user will need to be created; to add a user execute the following steps on the remote instance.
Navigate to the
bindirectorycd $JDG_HOME/bin
Execute the
add-user.shscript../add-user.sh
-
Accept the default option of
ManagementUserby pressing return. -
Accept the default option of
ManagementRealmby pressing return. -
Enter the desired username. In this example
jmxadminwill be used. - Enter and confirm the password.
- Accept the default option of no groups by pressing return.
-
Confirm that the desired user will be added to the
ManagementRealmby enteringyes. -
Enter
noas this user will not be used for connections between processes. The following image shows an example execution run.
Figure C.1. Execution of add-user.sh

Binding the Management Interface
By default JBoss Data Grid will start with the management interface binding to 127.0.0.1. In order to connect remotely this interface must be bound to an IP address that is visible by the network. Either of the following options will correct this:
Option 1: Runtime - By adjusting the
jboss.bind.address.managementproperty on startup a new IP address can be specified. In the following example JBoss Data Grid is starting with this bound to 192.168.122.5:./standalone.sh ... -Djboss.bind.address.management=192.168.122.5
Option 2: Configuration - Adjust the
jboss.bind.address.managementin the configuration file. This is found in theinterfacessubsystem. A snippet of the configuration file, with the IP adjusted to 192.168.122.5, is provided below:<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:192.168.122.5}"/> </interface> [...] </interface>
Running JConsole
A jconsole.sh script is provided in the $JDG_HOME/bin directory. Executing this script will launch JConsole.
Connecting to a remote JBoss Data Grid instance using JConsole.
Execute the
$JDG_HOME/bin/jconsole.shscript. This will result in the following window appearing:Figure C.2. JConsole

-
Select
Remote Process. -
Enter
service:jmx:remote://$IP:9990in the text area. -
Enter the username and password, created from the
add-user.shscript. -
Click
Connectto initiate the connection. Once connected ensure that the cache-related nodes may be viewed. The following screenshot shows such a node.
Figure C.3. JConsole: Showing a Cache


Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.