Red Hat JBoss Data Grid

Subtitle
An intelligent, distributed caching solution that boosts application performance, provides greater deployment flexibility, and minimizes the overhead of standing up new applications.

Red Hat JBoss Data Grid

Thank you for downloading

Your download should start automatically. If you have any problems with the download, please use the direct link.



Hello World!

1. Set up your Dev Environment

5 minutes

Body
  1. Install the Java SE Development Kit (JDK) 1.8. We recommend using the OpenJDK or the Oracle JDK.

    1. For Windows/Mac Development Hosts:

      1. Red Hat Developers typically downloads from Oracle’s link: site. (Make sure you get the Java Development Kit and not just the Java Runtime Environment).

    2. For Red Hat Enterprise Linux Hosts:

      1. Install OpenJDK by executing the following command:

        $ yum install java-1.8.0-openjdk-devel
    3. Follow the on-screen instructions to continue the installation process.

  2. Download the latest version of Red Hat JBoss Data Grid. The latest version at the time of writing is Red Hat JBoss Data Grid 7.0.0 Server

  3. Unzip JBoss Data Grid into your preferred destination folder; we will refer to this location as $JDG_HOME.

    1. In Windows or Mac, you can extract the contents of the ZIP archive by double clicking on the ZIP file.

    2. In Red Hat Enterprise Linux, open a terminal window in the target machine and navigate to where the ZIP file was downloaded. Extract the ZIP file by executing the following command:

      $ unzip jboss-datagrid-7.0.0-server.zip
  4. Download Red Hat JBoss EAP 7.0.0

  5. Extract JBoss EAP into your preferred destination folder; we will refer to this location as $JBOSS_HOME.

    1. In Windows or Mac, you can extract the contents of the ZIP archive by double clicking on the ZIP file.

    2. In Red Hat Enterprise Linux, open a terminal window in the target machine and navigate to where the ZIP file was downloaded. Extract the ZIP file by executing the following command:

      $ unzip jboss-eap-7.0.0.zip
  6. Download the latest version of Maven. The latest at the time of this writing is Maven 3.3.9. Choose the ZIP distribution.

  7. Unzip into the folder of your choice as we’ve done above for JBoss Data Grid; we’ll refer to this location as $MAVEN_HOME.

    Note: You may want to add $MAVEN_HOME/bin to your system $PATH in order to access its executable directly from the command-line, no matter your current working directory.

2. Install, Configure, and Verify

10 minutes

Body

To verify that JBoss Data Grid and JBoss EAP is working correctly, deploy and execute the helloworld-jdg quickstart application in an EAP server you will now create and configure:

  1. Test that your Maven and Java installations are working correctly by executing $MAVEN_HOME/bin/mvn --version and $JAVA_HOME/bin/java -version . For instance:

    $ mvn --version
    Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
    Maven home: /opt/apache/apache-maven-3.3.9
    Java version: 1.8.0_92, vendor: Oracle Corporation
    Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.92-4.b14.fc23.x86_64/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "4.5.7-202.fc23.x86_64", arch: "amd64", family: "unix"
  2. In one terminal window, start an instance of JBoss EAP by executing $JBOSS_HOME/bin/standalone.sh (Linux and Mac) or %JBOSS_HOME%\bin\standalone.bat (Windows)

    $ $JBOSS_HOME/bin/standalone.sh
  3. In a second window, start another instance of JBoss EAP by passing the system property jboss.socket.binding.port-offset to the standalone script, ie:

    $ $JBOSS_HOME/bin/standalone.sh -Djboss.socket.binding.port-offset=100
  4. In a third terminal window, download the quickstarts:

    Red Hat JBoss Data Grid 7 Quickstarts

  5. Extract the quickstarts ZIP as we’ve done before, or using unzip

    $ unzip jboss-datagrid-7.0.0-quickstarts.zip
  6. Move into the quickstarts directory

    $ cd jboss-datagrid-7.0.0-quickstarts
  7. Build the helloworld-jdg quickstart web application and deploy it into the first instance of JBoss EAP by executing:

    $ cd helloworld-jdg
    $ mvn clean package wildfly:deploy -s ../settings.xml
  8. Deploy the quickstart web application into the second instance of JBoss EAP by executing:

    $ mvn wildfly:deploy -s ../settings.xml -Dwildfly.port=10090

    The application will be running at the following URLs:

Instance 1:

JBoss Enterprise Application Instance 1

Instance 2:

JBoss Enterprise Application Instance 2

You can test replication of entries in the following way:

  1. Access first server at http://localhost:8080/jboss-helloworld-jdg and insert key "foo" with value "bar"

  2. Access second server at http://localhost:8180/jboss-helloworld-jdg and do the following:

    1. Click on Get Some

    2. Get the value for key "foo"

    3. Click Put Some More

    4. Insert key "mykey" with value "myvalue"

  3. Access the first server at http://localhost:8080/jboss-helloworld-jdg and do the following:

    1. Click on Get Some

    2. Get all mappings by clicking on Get All

  4. All data entered on each server was replicated to the other server

    Note: Entries expire and simply disappear after 60 seconds from last update. To access predefined servlets and directly store/retrieve a key in the cache, access the following URLs: http://localhost:8080/jboss-helloworld-jdg/TestServletPut http://localhost:8180/jboss-helloworld-jdg/TestServletGet (note the different port 8180)

  5. Make sure you have started JBoss EAP as described above.

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

  7. When you are finished testing, type the following commands to undeploy the archive from both running servers:

    $ mvn wildfly:undeploy -s ../settings.xml
    $ mvn wildfly:undeploy -s ../settings.xml -Dwildfly.port=10090

3. Build your first JBoss Data Grid application

20 minutes

Body

Follow the below series to build your first application. You will build some simple examples.

Step 1: Learn more about getting started

JBoss Data Grid Getting Started Guide

Additional Content

Build Something Today

Let's walk through everything you need to build your first application.

Download Get Started
×