Appendix B. Connecting with JConsole
B.1. Connect to JDG via JConsole
Procedure B.1. Add Management User to JBoss Data Grid
- Navigate to the
bin
directorycd $JDG_HOME/bin
- Execute the
add-user.sh
script../add-user.sh
- Accept the default option of
ManagementUser
by pressing return. - Accept the default option of
ManagementRealm
by pressing return. - Enter the desired username. In this example
jmxadmin
will 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
ManagementRealm
by enteringyes
. - Enter
no
as this user will not be used for connections between processes. - The following image shows an example execution run.
Figure B.1. Execution of add-user.sh
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.management
property 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.management
in the configuration file. This is found in theinterfaces
subsystem. 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>
A jconsole.sh
script is provided in the $JDG_HOME/bin
directory. Executing this script will launch JConsole.
Procedure B.2. Connecting to a remote JBoss Data Grid instance using JConsole
- Execute the
$JDG_HOME/bin/jconsole.sh
script. This will result in the following window appearing:Figure B.2. JConsole
- Select
Remote Process
. - Enter
service:jmx:remoting-jmx://$IP:9999
in the text area. - Enter the username and password, created from the
add-user.sh
script. - Click
Connect
to initiate the connection. - Once connected ensure that the cache-related nodes may be viewed. The following screenshot shows such a node.
Figure B.3. JConsole: Showing a Cache