Questo contenuto non è disponibile nella lingua selezionata.

Chapter 2. Getting Started with Data Grid Server


Quickly set up Data Grid server and learn the basics.

2.1. Data Grid Server Requirements

Check host system requirements for the Data Grid server.

See the Red Hat Data Grid Supported Configurations.

2.2. Downloading Server Distributions

The Data Grid server distribution is an archive of Java libraries (JAR files), configuration files, and a data directory.

Procedure

  1. Access the Red Hat customer portal.
  2. Download the Red Hat Data Grid 8.0 server from the software downloads section.

Verification

Use the checksum to verify the integrity of your download.

  1. Run the md5sum or sha256sum command with the server download archive as the argument, for example:

    $ sha256sum jboss-datagrid-${version}-server.zip
    Copy to Clipboard Toggle word wrap
  2. Compare with the MD5 or SHA-256 checksum value on the Data Grid Software Details page.

Reference

Data Grid Server README describes the contents of the server distribution.

2.3. Installing Data Grid Server

Extract the Data Grid server archive to any directory on your host.

Procedure

Use any extraction tool with the server archive, for example:

$ unzip infinispan-server-${version}.zip
Copy to Clipboard Toggle word wrap

The resulting directory is your $RHDG_HOME.

2.4. Running Data Grid Servers

Spin up Data Grid server instances that automatically form clusters. Learn how to create cache definitions to store your data.

2.4.1. Starting Data Grid Servers

Launch Data Grid server with the startup script.

Procedure

  1. Open a terminal in $RHDG_HOME.
  2. Run the server script.

    Linux
    $ bin/server.sh
    Copy to Clipboard Toggle word wrap
    Microsoft Windows
    bin\server.bat
    Copy to Clipboard Toggle word wrap

    Server logs display the following messages:

    ISPN080004: Protocol SINGLE_PORT listening on 127.0.0.1:11222
    
    ISPN080001: Data Grid Server <$version> started in <mm>ms
    Copy to Clipboard Toggle word wrap

Hello Data Grid!

  • Open 127.0.0.1:11222 in any browser to access the Data Grid console.

Reference

Data Grid Server README describes command line arguments for the server script.

2.4.2. Verifying Data Grid Cluster Discovery

By default Data Grid servers running on the same network discover each other with the MPING protocol.

This procedure shows you how to start two Data Grid servers on the same host and verify that the cluster view.

Prerequisites

Start a Data Grid server instance on your host.

Procedure

  1. Install and run a new Data Grid server instance.

    1. Open a terminal in $RHDG_HOME.
    2. Copy the root directory to server2.

      $ cp -r server server2
      Copy to Clipboard Toggle word wrap
  2. Specify a port offset and the location of the server2 root directory.

    $ bin/server.sh -o 100 -s server2
    Copy to Clipboard Toggle word wrap

Verification

Check the server logs for the following messages:

INFO  [org.infinispan.CLUSTER] (jgroups-11,<server_hostname>)
ISPN000094: Received new cluster view for channel cluster:
[<server_hostname>|3] (2) [<server_hostname>, <server2_hostname>]

INFO  [org.infinispan.CLUSTER] (jgroups-11,<server_hostname>)
ISPN100000: Node <server2_hostname> joined the cluster
Copy to Clipboard Toggle word wrap

2.5. Performing Operations with the Data Grid CLI

Connect to servers with the Data Grid command line interface (CLI) to access data and perform administrative functions.

2.5.1. Starting the Data Grid CLI

Start the Data Grid CLI as follows:

  1. Open a terminal in $ISPN_HOME.
  2. Run the CLI.

    $ bin/cli.sh
    [disconnected]>
    Copy to Clipboard Toggle word wrap

2.5.2. Connecting to Data Grid Servers

Do one of the following:

  • Run the connect command to connect to a Data Grid server on the default port of 11222:

    [disconnected]> connect
    [hostname1@cluster//containers/default]>
    Copy to Clipboard Toggle word wrap
  • Specify the location of a Data Grid server. For example, connect to a local server that has a port offset of 100:

    [disconnected]> connect 127.0.0.1:11322
    [hostname2@cluster//containers/default]>
    Copy to Clipboard Toggle word wrap
Tip

Press the tab key to display available commands and options. Use the -h option to display help text.

2.5.3. Creating Caches from Templates

Use Data Grid cache templates to add caches with recommended default settings.

Procedure

  1. Create a distributed, synchronous cache from a template and name it "mycache".

    [//containers/default]> create cache --template=org.infinispan.DIST_SYNC mycache
    Copy to Clipboard Toggle word wrap
    Tip

    Press the tab key after the --template= argument to list available cache templates.

  2. Retrieve the cache configuration.

    [//containers/default]> describe caches/mycache
    {
      "distributed-cache" : {
        "mode" : "SYNC",
        "remote-timeout" : 17500,
        "state-transfer" : {
          "timeout" : 60000
        },
        "transaction" : {
          "mode" : "NONE"
        },
        "locking" : {
          "concurrency-level" : 1000,
          "acquire-timeout" : 15000,
          "striping" : false
        },
        "statistics" : true
      }
    }
    Copy to Clipboard Toggle word wrap

2.5.4. Adding Cache Entries

Add data to caches with the Data Grid CLI.

Prerequisites

  • Create a cache named "mycache" and cd into it.

    [//containers/default]> cd caches/mycache
    Copy to Clipboard Toggle word wrap

Procedure

  1. Put an entry into "mycache".

    [//containers/default/caches/mycache]> put hello world
    Copy to Clipboard Toggle word wrap
    Tip

    If not in the context of a cache, use the --cache= parameter. For example:

    [//containers/default]> put --cache=mycache hello world
    Copy to Clipboard Toggle word wrap
  2. Get the entry to verify it.

    [//containers/default/caches/mycache]> get hello
    world
    Copy to Clipboard Toggle word wrap

2.5.5. Shutting Down Data Grid Servers

Use the CLI to gracefully shutdown running servers. This ensures that Data Grid passivates all entries to disk and persists state.

  • Use the shutdown server command to stop individual servers.

    [//containers/default]> shutdown server $hostname
    Copy to Clipboard Toggle word wrap
  • Use the shutdown cluster command to stop all servers joined to the cluster.

    [//containers/default]> shutdown cluster
    Copy to Clipboard Toggle word wrap

Verification

Check the server logs for the following messages:

ISPN080002: Data Grid Server stopping
ISPN000080: Disconnecting JGroups channel cluster
ISPN000390: Persisted state, version=<$version> timestamp=YYYY-MM-DDTHH:MM:SS
ISPN080003: Data Grid Server stopped
Copy to Clipboard Toggle word wrap
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat