Skip to content
A visualization of the data grid
Java JavaScript
Find file
Latest commit 5684bac @saturnism saturnism don't poll internal caches such as ___hotRodTopology.
added a parameter to set refresh rates.


What is it?

This is a graphical JBoss Data Grid visualizer based on the 2011 JBoss World Keynote presented by Burr Sutter (

This visualizer works with out of the box JDG configuration with JMX and Management User configured (see below for instructions).

1 Configuring the Demo

This demo application uses a single instance of JBoss Enterprise Application server, and a cluster of JBoss Data Grid servers. The following steps document how to configure the servers whether you plan to build the demo from source or deploy a precompiled demo app.

1.1 System requirements

  • JBoss Data Grid 6.1
  • JBoss EAP 6.1
  • Maven 2

1.2 Add Management User to JBoss Data Grid

  • cd $JDG_HOME/bin
  • ./
  • Select <a> to add a Management User
  • Hit <Enter> for default realm (ManagementRealm)
  • Follow instructions to add a user with your username/password of your choice. ALL nodes should have the exact same login credentials in order for this visualizer to run correctly.

1.3 Configure the Java Heap

Decreasing the default EAP and JDG heap size will allow you to run the necessary JBoss instances on your host without running out of memory. The following java heap settings will typically allow for 1 EAP instance with up to 4 JDG instances on a single host (results may vary).

Edit the EAP $EAP_HOME/bin/standalone.conf file and modify the Java heap size to the following:

-Xms256m -Xmx1024m -XX:MaxPermSize=128m

Edit the $JDG_HOME/bin/standalone.conf file and modify the Java heap size to the following:

-Xms128m -Xmx384m -Xss2048k -XX:MaxPermSize=128m 

1.4 Configure the Lab Cache

This demo requires a cache to be configured and exposed through the HotRod interface. Open the clustered JDG configuration file, $JDG_HOME/standalone/configuration/standalone-ha.xml, and add a distributed cache to the infinispan configuration section called labCache.

<subsystem xmlns="urn:jboss:domain:infinispan:1.3" default-cache-container="clustered">
    <cache-container name="clustered" default-cache="default">
        <transport executor="infinispan-transport" lock-timeout="60000"/>
        <distributed-cache name="labCache" mode="SYNC" virtual-nodes="1" owners="2" remote-timeout="30000" start="EAGER">
            <locking isolation="READ_COMMITTED" acquire-timeout="30000" concurrency-level="1000" striping="false"/>
            <transaction mode="NONE"/>

1.5 Create Instance Profiles

Each JBoss Data Grid instance should have its own instance directory. Make four copies of the $JDG_HOME/standalone directory. When starting up JDG the -Djboss.server.base.dir=<instance-directory-name> will be used to select the instance's execution directory.

cp -r $JDG_HOME/standalone $JDG_HOME/standalone1
cp -r $JDG_HOME/standalone $JDG_HOME/standalone2
cp -r $JDG_HOME/standalone $JDG_HOME/standalone3 

1.6 Configuring the Network Interface

For this visualizer to work in a clustered environment, each JDG node must use the standalone-ha.xml configuration (for clustering), and each JDG node must be running on a dedicated network interface. This can be achieved through IP aliasing or port offsets. This can be achieved through:

a. Running each data grid instance on the same IP address, but with port offsets.

b. The use of IP Aliasing. You may need to look up more documentation regarding IP Aliasing for your Operating System.

c. Running each JDG node in a virtual machine instance, each with a different IP address.

1.6a Using Port Offsets

Further configuration is not necessary. Port offsets may be specified on the command line startup, e.g.:

./ -b -bmanagement= -Djboss.socket.binding.port-offset=1 ...
./ -b -bmanagement= -Djboss.socket.binding.port-offset=2 ...

1.6b Using IP Aliases

An example to create local IP Aliases in Mac OS X:

sudo ifconfig lo0 alias
sudo ifconfig lo0 alias

Each JDG instance must bind to a specific IP address, e.g.:

./ -b -bmanagement= ...
./ -b -bmanagement= ...

1.6c Using Virtual Machines

If running JDG inside a VM, please make sure JDG is bound to the non-local network interface. (JDG binds to localhost unless otherwise specified), e.g.:

./ -b -bmanagement= ...

1.7 Deploy the Visualizer

  • Copy the Visualizer to the EAP deployments directory:

    cp jdg-visualizer.war $EAP_HOME/standalone/deployments```
    + Create a marker file that signals EAP 6 to deploy the Web Archive

    echo "" > $EAP_HOME/standalone/deployments/jdg-visualizer.war.dodeploy```

2 Running the Demo

2.1 Starting the Data Grid Instances

Open a command line and navigate to the root of the JBoss Data Grid server directory $JDG_HOME for each instance you want to start.

Start each instance, ensuring the address and ports will not conflict with each other or the JBoss EAP instance.

bin/ -b localhost -bmanagement=localhost -Djboss.server.base.dir=standalone1 -Djboss.socket.binding.port-offset=1

bin/ -b localhost -bmanagement=localhost -Djboss.server.base.dir=standalone2 -Djboss.socket.binding.port-offset=2

bin/ -b localhost -bmanagement=localhost -Djboss.server.base.dir=standalone3 -Djboss.socket.binding.port-offset=3
  • use bin/ for Linux/Unix and bin\standalone.bat for Windows
  • -c specifies the configuration file to use; standalone-ha.xml must be used to form a cluster.
  • -b and -bmanagement specify the IP Address to bind the data grid to. If running the the demo on an isolated host then specify localhost. If running the demo with other hosts on a network the specify the IP Address of the network interface you would like to bind to. Both the NIC configuration and the network must support multicast for the data grid to be dynamically formed.
  • must be unique for each JDG instance
  • -Djboss.server.base.dir should point to a profile dirctory tree under the $JDG_HOME directory. This should not be shared between instances.
  • -Djboss.socket.binding.port-offset specifies the offset from the default port bindings. 11222+offset for Hotrod. 9999+offset for JMX

2.2 Start the Application Server

Open a command line and navigate to the root of the JBoss EAP server directory $EAP_HOME.

Start the application server and specify the visualizer's demo parameters.

bin/ -b -bmanagement= -Djdg.visualizer.jmxUser=admin -Djdg.visualizer.jmxPass=p455w0rd -Djdg.visualizer.serverList=localhost:11223
  • use bin/ for Linux/Unix and bin\standalone.bat for Windows
  • -b and -bmanagement should be set to the external IP address of your host
  • jdg.visualizer.jmxUser and jdg.visualizer.jmxPass should be set to the credentials of the JBoss Data Grid servers you configured in step '1.2 Add Management User to JBoss Data Grid'
  • jdg.visualizer.serverList must set to the <IPAddress>:<HotRodPort> combination of at least one of the JDG servers you started in step '2.1 Starting the Data Grid Instances'. To specify multiple addresses wrap with quotes and delimit with a semicolon, e.g.: -Djdg.visualizer.serverList='localhost:11223;localhost:11224'
  • jdg.visualizer.refreshRate This is refresh rate determines how often Visualizer should poll data from JDG servers. If onset, this defaults to 2000 - which means 2000ms delay between data polling.

2.3 View the Demo Application

The application will be running at the following URL: http://localhost:8080/jdg-visualizer/.

NOTE: Before accessing the application, please ensure a JDG server is up and running!

2.4 Load Data into the Grid

Use the hotrod-demo application to load data into the grid:

3 Building from Source

3.1 Configure Maven

See here to make sure JBoss Repository is configured -

In addition, please make sure JDG 6 repository is configured based on JDG 6 Maven Repository installation instructions. If not using JDG 6, please change the pom.xml so that the Infinispan dependency is based on community project.

NOTE: This code hasn't been tested w/ Infinispan community project.

3.2 Building the Application

To build the application first make sure you have configured maven to use the JBoss Data Grid reppository or the Community Infinispan respository.

mvn clean package

3.3 Build and Deploy from Source

NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See Build and Deploy the Quickstarts for complete instructions and additional options.

a. Make sure you have started the JBoss Server as described above.

b. Open a command line and navigate to the root directory of this quickstart.

c. Type this command to build and deploy the archive:

mvn clean package jboss-as:deploy

d. This will deploy target/jdg-visualizer.war to the running instance of the server.

3.4 Undeploy the Archive

a. Make sure you have started the JBoss Server as described above. b. Open a command line and navigate to the root directory of this quickstart. c. When you are finished testing, type this command to undeploy the archive:

mvn jboss-as:undeploy

3.5 Debug the Application

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
Something went wrong with that request. Please try again.