Data Grid Command Line Interface
Data Grid Documentation
Abstract
Chapter 1. Red Hat Data Grid Copy linkLink copied to clipboard!
Data Grid is a high-performance, distributed in-memory data store.
- Schemaless data structure
- Flexibility to store different objects as key-value pairs.
- Grid-based data storage
- Designed to distribute and replicate data across clusters.
- Elastic scaling
- Dynamically adjust the number of nodes to meet demand without service disruption.
- Data interoperability
- Store, retrieve, and query data in the grid from different endpoints.
1.1. Data Grid Documentation Copy linkLink copied to clipboard!
Documentation for Data Grid is available on the Red Hat customer portal.
1.2. Data Grid Downloads Copy linkLink copied to clipboard!
Access the Data Grid Software Downloads on the Red Hat customer portal.
You must have a Red Hat account to access and download Data Grid software.
Chapter 2. Getting Started with the Data Grid CLI Copy linkLink copied to clipboard!
The command line interface (CLI) lets you remotely connect to Data Grid servers to access data and perform administrative functions.
Prerequisites
- At least one running Data Grid server.
2.1. Starting the Data Grid CLI Copy linkLink copied to clipboard!
Start the Data Grid CLI as follows:
-
Open a terminal in
$ISPN_HOME. Run the CLI.
bin/cli.sh [disconnected]>
$ bin/cli.sh [disconnected]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Connecting to Data Grid Servers Copy linkLink copied to clipboard!
Do one of the following:
Run the
connectcommand to connect to a Data Grid server on the default port of11222:[disconnected]> connect [hostname1@cluster//containers/default]>
[disconnected]> connect [hostname1@cluster//containers/default]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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]>
[disconnected]> connect 127.0.0.1:11322 [hostname2@cluster//containers/default]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Press the tab key to display available commands and options. Use the -h option to display help text.
2.4. Resource statistics Copy linkLink copied to clipboard!
You can inspect server-collected statistics for some of the resources within a Data Grid server using the stats command. Use the stats command either from the context of a resource which collects statistics (containers, caches) or with a path to such a resource:
2.5. Shutting Down Data Grid Servers Copy linkLink copied to clipboard!
Use the CLI to gracefully shutdown running servers. This ensures that Data Grid passivates all entries to disk and persists state.
Use the
shutdown servercommand to stop individual servers.[//containers/default]> shutdown server $hostname
[//containers/default]> shutdown server $hostnameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
shutdown clustercommand to stop all servers joined to the cluster.[//containers/default]> shutdown cluster
[//containers/default]> shutdown clusterCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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
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
Chapter 3. Performing Cache Operations with the Data Grid CLI Copy linkLink copied to clipboard!
The command line interface (CLI) lets you remotely connect to Data Grid servers to access data and perform administrative functions.
Prerequisites
- Start the Data Grid CLI.
- Connect to a running Data Grid cluster.
3.1. Creating Caches from Templates Copy linkLink copied to clipboard!
Use Data Grid cache templates to add caches with recommended default settings.
Procedure
Create a distributed, synchronous cache from a template and name it "mycache".
[//containers/default]> create cache --template=org.infinispan.DIST_SYNC mycache
[//containers/default]> create cache --template=org.infinispan.DIST_SYNC mycacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow TipPress the tab key after the
--template=argument to list available cache templates.Retrieve the cache configuration.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Creating Caches from XML or JSON Files Copy linkLink copied to clipboard!
Add caches with custom Data Grid configuration in XML or JSON format.
Procedure
-
Add the path to your configuration file with the
--file=option as follows:
[//containers/default]> create cache --file=prod_dist_cache.xml dist_cache_01
[//containers/default]> create cache --file=prod_dist_cache.xml dist_cache_01
3.2.1. XML Configuration Copy linkLink copied to clipboard!
Data Grid configuration in XML format must conform to the schema and include:
-
<infinispan>root element. -
<cache-container>definition.
Example XML Configuration
3.2.2. JSON Configuration Copy linkLink copied to clipboard!
Data Grid configuration in JSON format:
- Requires the cache definition only.
Must follow the structure of an XML configuration.
- XML elements become JSON objects.
- XML attributes become JSON fields.
Example JSON Configuration
3.3. Adding Cache Entries Copy linkLink copied to clipboard!
Add data to caches with the Data Grid CLI.
Prerequisites
Create a cache named "mycache" and
cdinto it.[//containers/default]> cd caches/mycache
[//containers/default]> cd caches/mycacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Put an entry into "mycache".
[//containers/default/caches/mycache]> put hello world
[//containers/default/caches/mycache]> put hello worldCopy to Clipboard Copied! Toggle word wrap Toggle overflow TipIf not in the context of a cache, use the
--cache=parameter. For example:[//containers/default]> put --cache=mycache hello world
[//containers/default]> put --cache=mycache hello worldCopy to Clipboard Copied! Toggle word wrap Toggle overflow Get the entry to verify it.
[//containers/default/caches/mycache]> get hello world
[//containers/default/caches/mycache]> get hello worldCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.4. Clearing Caches and Deleting Entries Copy linkLink copied to clipboard!
Remove data from caches with the Data Grid CLI.
Procedure
Clear caches. This command deletes all entries from a cache.
[//containers/default]> clearcache mycache
[//containers/default]> clearcache mycacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove specific entries from a cache.
[//containers/default]> remove --cache=mycache hello
[//containers/default]> remove --cache=mycache helloCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.5. Deleting Caches Copy linkLink copied to clipboard!
Drop caches to remove them and delete all data they contain.
Procedure
Remove caches with the drop command.
[//containers/default]> drop cache mycache
[//containers/default]> drop cache mycacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 4. Performing Batch Operations Copy linkLink copied to clipboard!
Process operations in groups, either interactively or using batch files.
Prerequisites
- A running Data Grid cluster.
4.1. Performing Batch Operations with Files Copy linkLink copied to clipboard!
Create files that contain a set of operations and then pass them to the Data Grid CLI.
Procedure
Create a file that contains a set of operations.
For example, create a file named
batchthat creates a cache namedmybatch, adds two entries to the cache, and disconnects from the CLI.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the CLI and specify the file as input.
bin/cli.sh -c localhost:11222 -f batch
$ bin/cli.sh -c localhost:11222 -f batchCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open a new CLI connection to Data Grid and verify
mybatch.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Performing Batch Operations Interactively Copy linkLink copied to clipboard!
Use the standard input stream, stdin, to perform batch operations interactively.
Procedure
Start the Data Grid CLI in interactive mode.
bin/cli.sh -c localhost:11222 -f -
$ bin/cli.sh -c localhost:11222 -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you do not use the
-cflag, you must run theconnectcommand.bin/cli.sh -f - connect
$ bin/cli.sh -f - connectCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run batch operations, for example:
create cache --template=org.infinispan.DIST_SYNC mybatch put --cache=mybatch hello world put --cache=mybatch hola mundo disconnect quit
create cache --template=org.infinispan.DIST_SYNC mybatch put --cache=mybatch hello world put --cache=mybatch hola mundo disconnect quitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Use echo to add commands in interactive mode.
The following example shows how to use echo describe to get cluster information:
Chapter 5. Working with Counters Copy linkLink copied to clipboard!
Counters provide atomic increment and decrement operations that record the count of objects.
Prerequisites
- Start the Data Grid CLI.
- Connect to a running Data Grid cluster.
5.1. Creating Counters Copy linkLink copied to clipboard!
Create strong and weak counters with the Data Grid CLI.
Procedure
Run
create counterwith the appropriate arguments.Create
my-weak-counter.[//containers/default]> create counter --concurrency-level=1 --initial-value=5 --storage=PERSISTENT --type=weak my-weak-counter
[//containers/default]> create counter --concurrency-level=1 --initial-value=5 --storage=PERSISTENT --type=weak my-weak-counterCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create
my-strong-counter.[//containers/default]> create counter --initial-value=3 --storage=PERSISTENT --type=strong my-strong-counter
[//containers/default]> create counter --initial-value=3 --storage=PERSISTENT --type=strong my-strong-counterCopy to Clipboard Copied! Toggle word wrap Toggle overflow
List available counters.
[//containers/default]> ls counters my-strong-counter my-weak-counter
[//containers/default]> ls counters my-strong-counter my-weak-counterCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify counter configurations.
Describe
my-weak-counter.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Describe
my-strong-counter.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Adding Deltas to Counters Copy linkLink copied to clipboard!
Increment or decrement counters with arbitrary values.
Procedure
Select a counter.
[//containers/default]> counter my-weak-counter
[//containers/default]> counter my-weak-counterCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the current count.
[//containers/default/counters/my-weak-counter]> ls 5
[//containers/default/counters/my-weak-counter]> ls 5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Increment the counter value by
2.[//containers/default/counters/my-weak-counter]> add --delta=2
[//containers/default/counters/my-weak-counter]> add --delta=2Copy to Clipboard Copied! Toggle word wrap Toggle overflow Decrement the counter value by
-4.[//containers/default/counters/my-weak-counter]> add --delta=-4
[//containers/default/counters/my-weak-counter]> add --delta=-4Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Strong counters return values after the operation is applied. Use --quiet=true to hide the return value.
For example, my-strong-counter]> add --delta=3 --quiet=true.
Weak counters return empty responses.
Chapter 6. Querying Caches with Protobuf Metadata Copy linkLink copied to clipboard!
Data Grid supports using Protocol Buffers (Protobuf) to structure data in the cache so that you can query it.
Prerequisites
- Start the Data Grid CLI.
- Connect to a running Data Grid cluster.
6.1. Configuring Media Types Copy linkLink copied to clipboard!
Encode cache entries with different media types to store data in a format that best suits your requirements.
For example, the following procedure shows you how to configure the application/x-protostream media type.
Procedure
Create a Data Grid configuration file that adds a distributed cache named
qcacheand configures the media type, for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create
qcachefrompcache.xmlwith the--file=option.[//containers/default]> create cache --file=pcache.xml pcache
[//containers/default]> create cache --file=pcache.xml pcacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify
pcache.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add an entry to
pcacheand check the encoding.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2. Registering Protobuf Schemas Copy linkLink copied to clipboard!
Protobuf schemas contain data structures known as messages in .proto definition files.
Procedure
Create a schema file named
person.protowith the following messages:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Register
person.proto.[//containers/default]> schema --upload=person.proto person.proto
[//containers/default]> schema --upload=person.proto person.protoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify
person.proto.[//containers/default]> cd caches/___protobuf_metadata [//containers/default/caches/___protobuf_metadata]> ls person.proto [//containers/default/caches/___protobuf_metadata]> get person.proto
[//containers/default]> cd caches/___protobuf_metadata [//containers/default/caches/___protobuf_metadata]> ls person.proto [//containers/default/caches/___protobuf_metadata]> get person.protoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3. Querying Caches with Protobuf Schemas Copy linkLink copied to clipboard!
Data Grid automatically converts JSON to Protobuf so that you can read and write cache entries in JSON format and use Protobuf schemas to query them.
For example, consider the following JSON documents:
lukecage.json
jessicajones.json
matthewmurdock.json
Each of the preceding JSON documents contains:
-
a
_typefield that identifies the Protobuf message to which the JSON document corresponds. -
several fields that correspond to datatypes in the
person.protoschema.
Procedure
Navigate to the
pcachecache.[//containers/default/caches]> cd pcache
[//containers/default/caches]> cd pcacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add each JSON document as an entry to the cache, for example:
[//containers/default/caches/pcache]> put --encoding=application/json --file=jessicajones.json jessicajones [//containers/default/caches/pcache]> put --encoding=application/json --file=matthewmurdock.json matthewmurdock [//containers/default/caches/pcache]> put --encoding=application/json --file=lukecage.json lukecage
[//containers/default/caches/pcache]> put --encoding=application/json --file=jessicajones.json jessicajones [//containers/default/caches/pcache]> put --encoding=application/json --file=matthewmurdock.json matthewmurdock [//containers/default/caches/pcache]> put --encoding=application/json --file=lukecage.json lukecageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the entries exist.
[//containers/default/caches/pcache]> ls lukecage matthewmurdock jessicajones
[//containers/default/caches/pcache]> ls lukecage matthewmurdock jessicajonesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Query the cache to return entries from the Protobuf
Personentity where the gender datatype isMALE.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 7. Performing Cross-Site Replication Operations Copy linkLink copied to clipboard!
Data Grid clusters running in different locations can discover and communicate with each other to backup data.
Prerequisites
- Start the Data Grid CLI.
- Connect to a running Data Grid cluster.
7.1. Bringing Backup Locations Offline and Online Copy linkLink copied to clipboard!
Take backup locations offline manually and bring them back online.
Procedure
Check if backup locations are online or offline with the
site statuscommand://containers/default]> site status --cache=cacheName --site=NYC
//containers/default]> site status --cache=cacheName --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note--siteis an optional argument. If not set, the CLI returns all backup locations.Bring backup locations online with the
bring-onlinecommand://containers/default]> site bring-online --cache=customers --site=NYC
//containers/default]> site bring-online --cache=customers --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow Take backup locations offline with the
take-offlinecommand://containers/default]> site take-offline --cache=customers --site=NYC
//containers/default]> site take-offline --cache=customers --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information and examples, run the help site command.
7.2. Pushing State to Backup Locations Copy linkLink copied to clipboard!
Transfer cache state to remote backup locations.
Procedure
Use the
sitecommand to push state transfer, as in the following example://containers/default]> site push-site-state --cache=cacheName --site=NYC
//containers/default]> site push-site-state --cache=cacheName --site=NYCCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information and examples, run the help site command.
Chapter 8. Patching Data Grid Server Installations Copy linkLink copied to clipboard!
Install and manage patches for Data Grid server installations.
You can apply patches to multiple Data Grid servers with different versions to upgrade to a desired target version. However, patches do not take effect if Data Grid servers are running. For this reason you install patches while servers are offline. If you want to upgrade Data Grid clusters without downtime, create a new cluster with the target version and perform a rolling upgrade to that version instead of patching.
8.1. Data Grid Server Patches Copy linkLink copied to clipboard!
Data Grid server patches are .zip archives that contain artifacts that you can apply to your $RHDG_HOME directory to fix issues and add new features.
Patches also provide a set of rules for Data Grid to modify your server installation. When you apply patches, Data Grid overwrites some files and removes others, depending on if they are required for the target version.
However, Data Grid does not make any changes to configuration files that you have created or modified when applying a patch. Server patches do not modify or replace any custom configuration or data.
8.2. Downloading Server Patches Copy linkLink copied to clipboard!
Download patches that you can apply to Data Grid servers.
Procedure
- Access the Red Hat customer portal.
- Download the appropriate Data Grid server patch from the software downloads section.
-
Open a terminal window and navigate to
$RHDG_HOME. Start the CLI.
bin/cli.sh [disconnected]>
$ bin/cli.sh [disconnected]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Describe the patch file you downloaded.
[disconnected]> patch describe /path/to/redhat-datagrid-$version-server-patch.zip Red Hat Data Grid patch target=$target_version source=$source_version created=$timestamp
[disconnected]> patch describe /path/to/redhat-datagrid-$version-server-patch.zip Red Hat Data Grid patch target=$target_version source=$source_version created=$timestampCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
$target_versionis the Data Grid version that applies when you install the patch on a server. -
$source_versionis one or more Data Grid server versions where you can install the patch.
-
Verification
Use the checksum to verify the integrity of your download.
Run the
md5sumorsha256sumcommand with the downloaded patch as the argument, for example:sha256sum redhat-datagrid-$version-server-patch.zip
$ sha256sum redhat-datagrid-$version-server-patch.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Compare with the
MD5orSHA-256checksum value on the Data Grid Software Details page.
8.3. Creating Server Patches Copy linkLink copied to clipboard!
You can create patches for Data Grid servers from an existing server installation.
You can create patches for Data Grid servers starting from 8.0.1. You can patch 8.0 GA servers with 8.0.1. However you cannot patch 7.3.x or earlier servers with 8.0.1 or later.
You can also create patches that either upgrade or downgrade the Data Grid server version. For example, you can create a patch from version 8.0.1 and use it to upgrade version 8.0 GA or downgrade a later version.
Red Hat supports patched server deployments only with patches that you download from the Red Hat customer portal. Red Hat does not support server patches that you create yourself.
Procedure
-
Navigate to
$RHDG_HOMEfor a Data Grid server installation that has the target version for the patch you want to create. Start the CLI.
bin/cli.sh [disconnected]>
$ bin/cli.sh [disconnected]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
patch createcommand to generate a patch archive and include the-qoption with a meaningful qualifier to describe the patch.[disconnected]> patch create -q "this is my test patch" path/to/mypatch.zip \ path/to/target/server/home path/to/source/server/home
[disconnected]> patch create -q "this is my test patch" path/to/mypatch.zip \ path/to/target/server/home path/to/source/server/homeCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command generates a
.ziparchive in the specified directory. Paths are relative to$RHDG_HOMEfor the target server.TipCreate single patches for multiple different Data Grid versions, for example:
[disconnected]> patch create -q "this is my test patch" path/to/mypatch.zip \ path/to/target/server/home \ path/to/source/server1/home path/to/source/server2/home
[disconnected]> patch create -q "this is my test patch" path/to/mypatch.zip \ path/to/target/server/home \ path/to/source/server1/home path/to/source/server2/homeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Where
server1andserver2are different Data Grid versions where you can install "mypatch.zip".Describe the generated patch archive.
[disconnected]> patch describe path/to/mypatch.zip Red Hat Data Grid patch target=$target_version(my test patch) source=$source_version created=$timestamp
[disconnected]> patch describe path/to/mypatch.zip Red Hat Data Grid patch target=$target_version(my test patch) source=$source_version created=$timestampCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
$target_versionis the Data Grid server version from which the patch was created. $source_versionis one or more Data Grid server versions to which you can apply the patch.You can apply patches to Data Grid servers that match the
$source_versiononly. Attempting to apply patches to other versions results in the following exception:java.lang.IllegalStateException: The supplied patch cannot be applied to `$source_version`
java.lang.IllegalStateException: The supplied patch cannot be applied to `$source_version`Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
8.4. Installing Server Patches Copy linkLink copied to clipboard!
Apply patches to Data Grid servers to upgrade or downgrade an existing version.
Prerequisites
- Download a server patch for the target version.
Procedure
-
Navigate to
$RHDG_HOMEfor the Data Grid server you want to patch. Stop the server if it is running.
NoteIf you patch a server while it is running, the version changes take effect after restart. If you do not want to stop the server, create a new cluster with the target version and perform a rolling upgrade to that version instead of patching.
Start the CLI.
bin/cli.sh [disconnected]>
$ bin/cli.sh [disconnected]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the patch.
[disconnected]> patch install path/to/patch.zip Red Hat Data Grid patch target=$target_version source=$source_version \ created=$timestamp installed=$timestamp
[disconnected]> patch install path/to/patch.zip Red Hat Data Grid patch target=$target_version source=$source_version \ created=$timestamp installed=$timestampCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
$target_versiondisplays the Data Grid version that the patch installed. -
$source_versiondisplays the Data Grid version before you installed the patch.
-
Start the server to verify the patch is installed.
bin/server.sh ... ISPN080001: Red Hat Data Grid Server $version
$ bin/server.sh ... ISPN080001: Red Hat Data Grid Server $versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the patch is installed successfully
$versionmatches$target_version.
Use the --server option to install patches in a different $RHDG_HOME directory, for example:
[disconnected]> patch install path/to/patch.zip --server=path/to/server/home
[disconnected]> patch install path/to/patch.zip --server=path/to/server/home
8.5. Rolling Back Server Patches Copy linkLink copied to clipboard!
Remove patches from Data Grid servers by rolling them back and restoring the previous Data Grid version.
If a server has multiple patches installed, you can roll back the last installed patch only.
Rolling back patches does not revert configuration changes you make to Data Grid server. Before you roll back patches, you should ensure that your configuration is compatible with the version to which you are rolling back.
Procedure
-
Navigate to
$RHDG_HOMEfor the Data Grid server installation you want to roll back. - Stop the server if it is running.
Start the CLI.
bin/cli.sh [disconnected]>
$ bin/cli.sh [disconnected]>Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the installed patches.
[disconnected]> patch ls Red Hat Data Grid patch target=$target_version source=$source_version created=$timestamp installed=$timestamp
[disconnected]> patch ls Red Hat Data Grid patch target=$target_version source=$source_version created=$timestamp installed=$timestampCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
$target_versionis the Data Grid server version after the patch was applied. -
$source_versionis the version for Data Grid server before the patch was applied. Rolling back the patch restores the server to this version.
-
Roll back the last installed patch.
[disconnected]> patch rollback
[disconnected]> patch rollbackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Quit the CLI.
[disconnected]> quit
[disconnected]> quitCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the server to verify the patch is rolled back to the previous version.
bin/server.sh ... ISPN080001: Data Grid Server $version
$ bin/server.sh ... ISPN080001: Data Grid Server $versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the patch is rolled back successfully
$versionmatches$source_version.
Use the --server option to rollback patches in a different $RHDG_HOME directory, for example:
[disconnected]> patch rollback --server=path/to/server/home
[disconnected]> patch rollback --server=path/to/server/home
Chapter 9. Command Reference Copy linkLink copied to clipboard!
Review manual pages for Data Grid CLI commands.
Use help command to access manual pages directly from your CLI session.
For example, to view the manual page for the get command do the following:
help get
$ help get
9.1. ADD(1) Copy linkLink copied to clipboard!
9.1.1. NAME Copy linkLink copied to clipboard!
add - increments and decrements counters with arbitrary values.
9.1.2. SYNOPSIS Copy linkLink copied to clipboard!
add ['OPTIONS'] ['COUNTER_NAME']
9.1.3. OPTIONS Copy linkLink copied to clipboard!
- --delta='nnn'
-
Sets a delta to increment or decrement the counter value. Defaults to
1. - -q, --quiet='[true|false]'
-
Hides return values for strong counters. The default is
false.
9.1.4. EXAMPLES Copy linkLink copied to clipboard!
add --delta=10 cnt_a
Increments the value of cnt_a by 10.
add --delta=-5 cnt_a
Decrements the value of cnt_a by 5.
9.1.5. SEE ALSO Copy linkLink copied to clipboard!
cas(1), reset(1)
9.2. CACHE(1) Copy linkLink copied to clipboard!
9.2.1. NAME Copy linkLink copied to clipboard!
cache - selects the default cache for subsequent commands.
9.2.2. SYNOPSIS Copy linkLink copied to clipboard!
cache ['CACHE_NAME']
9.2.3. EXAMPLE Copy linkLink copied to clipboard!
cache mycache
Selects mycache and is the same as navigating the resource tree using cd caches/mycache.
9.2.4. SEE ALSO Copy linkLink copied to clipboard!
cd(1), clear(1), container(1), get(1), put(1), remove(1)
9.3. CAS(1) Copy linkLink copied to clipboard!
9.3.1. NAME Copy linkLink copied to clipboard!
cas - performs 'compare-and-swap' operations on strong counters.
9.3.2. SYNOPSIS Copy linkLink copied to clipboard!
cas ['OPTIONS'] ['COUNTER_NAME']
9.3.3. OPTIONS Copy linkLink copied to clipboard!
- --expect='nnn'
- Specifies the expected value of the counter.
- --value='nnn'
- Sets a new value for the counter.
- -q, --quiet='[true|false]'
- Hides return values. The default is false.
9.3.4. EXAMPLE Copy linkLink copied to clipboard!
cas --expect=10 --value=20 cnt_a
Sets the value of cnt_a to 20 only if the current value is 10
9.3.5. SEE ALSO Copy linkLink copied to clipboard!
add(1), cas(1), reset(1)
9.4. CD(1) Copy linkLink copied to clipboard!
9.4.1. NAME Copy linkLink copied to clipboard!
cd - navigates the server resource tree.
9.4.2. DESCRIPTION Copy linkLink copied to clipboard!
PATH can be absolute or relative to the current resource. ../ specifies parent resources.
9.4.3. SYNOPSIS Copy linkLink copied to clipboard!
cd ['PATH']
9.4.4. EXAMPLE Copy linkLink copied to clipboard!
cd caches
Changes to the caches path in the resource tree.
9.4.5. SEE ALSO Copy linkLink copied to clipboard!
cache(1), ls(1), container(1)
9.5. CLEARCACHE(1) Copy linkLink copied to clipboard!
9.5.1. NAME Copy linkLink copied to clipboard!
clearcache - removes all entries from a cache.
9.5.2. SYNOPSIS Copy linkLink copied to clipboard!
clearcache ['CACHE_NAME']
9.5.3. EXAMPLES Copy linkLink copied to clipboard!
clearcache mycache
Removes all entries from mycache.
9.5.4. SEE ALSO Copy linkLink copied to clipboard!
cache(1), drop(1), remove(1)
9.6. CONNECT(1) Copy linkLink copied to clipboard!
9.6.1. NAME Copy linkLink copied to clipboard!
connect - connects to running ${infinispan.brand.name} servers.
9.6.2. DESCRIPTION Copy linkLink copied to clipboard!
Defaults to http://localhost:11222 and prompts for credentials if authentication is required.
9.6.3. SYNOPSIS Copy linkLink copied to clipboard!
connect ['OPTIONS'] ['SERVER_LOCATION']
9.6.4. OPTIONS Copy linkLink copied to clipboard!
- -u, --username='USERNAME'
- Specifies a username to authenticate with ${infinispan.brand.name} servers.
- -p, --password='PASSWORD'
- Specifies passwords.
9.6.5. EXAMPLE Copy linkLink copied to clipboard!
connect 127.0.0.1:11322 -u test -p changeme
Connects to a locally running server using a port offset of 100 and example credentials.
9.6.6. SEE ALSO Copy linkLink copied to clipboard!
disconnect(1)
9.7. CONTAINER(1) Copy linkLink copied to clipboard!
9.7.1. NAME Copy linkLink copied to clipboard!
container - selects the container for running subsequent commands.
9.7.2. SYNOPSIS Copy linkLink copied to clipboard!
container ['CONTAINER_NAME']
9.7.3. EXAMPLE Copy linkLink copied to clipboard!
container default
Selects the default container and is the same as navigating the resource tree using cd containers/default.
9.7.4. SEE ALSO Copy linkLink copied to clipboard!
cd(1), clear(1), container(1), get(1), put(1), remove(1)
9.8. COUNTER(1) Copy linkLink copied to clipboard!
9.8.1. NAME Copy linkLink copied to clipboard!
counter - selects the default counter for subsequent commands.
9.8.2. SYNOPSIS Copy linkLink copied to clipboard!
counter ['COUNTER_NAME']
9.8.3. EXAMPLE Copy linkLink copied to clipboard!
counter cnt_a
Selects cnt_a and is the same as navigating the resource tree using cd counters/cnt_a.
9.8.4. SEE ALSO Copy linkLink copied to clipboard!
add(1), cas(1)
9.9. CREATE(1) Copy linkLink copied to clipboard!
9.9.1. NAME Copy linkLink copied to clipboard!
create - creates caches and counters on ${infinispan.brand.name} servers.
9.9.2. SYNOPSIS Copy linkLink copied to clipboard!
create cache ['OPTIONS'] CACHE_NAME
create counter ['OPTIONS'] COUNTER_NAME
9.9.3. CREATE CACHE OPTIONS Copy linkLink copied to clipboard!
- -f, --file='FILE'
- Specifies a configuration file in JSON or XML format.
- -t, --template='TEMPLATE'
- Specifies a configuration template. Use tab autocompletion to see available templates.
- -v, --volatile='[true|false]'
- Specifies whether the cache is persistent or volatile. The default is false.
9.9.4. CREATE COUNTER OPTIONS Copy linkLink copied to clipboard!
- -t, --type='[weak|strong]'
- Specifies if the counter is weak or strong.
- -s, --storage='[PERSISTENT|VOLATILE]'
- Specifies whether the counter is persistent or volatile.
- -c, --concurrency-level='nnn'
- Sets the concurrency level of the counter.
- -i, --initial-value='nnn'
- Sets the initial value of the counter.
- -l, --lower-bound='nnn'
- Sets the lower bound of a strong counter.
- -u, --upper-bound='nnn'
- Sets the upper bound of a strong counter.
9.9.5. EXAMPLES Copy linkLink copied to clipboard!
create cache --template=org.infinispan.DIST_SYNC mycache
Creates a cache named mycache from the DIST_SYNC template.
create counter --initial-value=3 --storage=PERSISTENT --type=strong cnt_a
Creates a strong counter named cnt_a.
9.9.6. SEE ALSO Copy linkLink copied to clipboard!
drop(1)
9.10. DESCRIBE(1) Copy linkLink copied to clipboard!
9.10.1. NAME Copy linkLink copied to clipboard!
describe - displays information about resources.
9.10.2. SYNOPSIS Copy linkLink copied to clipboard!
describe ['PATH']
9.10.3. EXAMPLES Copy linkLink copied to clipboard!
describe //containers/default
Displays information about the default container.
describe //containers/default/caches/mycache
Displays information about the mycache cache.
describe //containers/default/caches/mycache/k1
Displays information about the k1 key.
describe //containers/default/counters/cnt1
Displays information about the cnt1 counter.
9.10.4. SEE ALSO Copy linkLink copied to clipboard!
cd(1), ls(1)
9.11. DISCONNECT(1) Copy linkLink copied to clipboard!
9.11.1. NAME Copy linkLink copied to clipboard!
disconnect - ends CLI sessions with ${infinispan.brand.name} servers.
9.11.2. SYNOPSIS Copy linkLink copied to clipboard!
disconnect
9.11.3. EXAMPLE Copy linkLink copied to clipboard!
disconnect
Ends the current CLI session.
9.11.4. SEE ALSO Copy linkLink copied to clipboard!
connect(1)
9.12. DROP(1) Copy linkLink copied to clipboard!
9.12.1. NAME Copy linkLink copied to clipboard!
drop - deletes caches and counters.
9.12.2. SYNOPSIS Copy linkLink copied to clipboard!
drop cache CACHE_NAME
drop counter COUNTER_NAME
9.12.3. EXAMPLES Copy linkLink copied to clipboard!
drop cache mycache
Deletes the mycache cache.
drop counter cnt_a
Deletes the cnt_a counter.
9.12.4. SEE ALSO Copy linkLink copied to clipboard!
create(1), clearcache(1)
9.13. ENCODING(1) Copy linkLink copied to clipboard!
9.13.1. NAME Copy linkLink copied to clipboard!
encoding - displays and sets the encoding for cache entries.
9.13.2. DESCRIPTION Copy linkLink copied to clipboard!
Sets a default encoding for put and get operations on a cache. If no argument is specified, the encoding command displays the current encoding.
Valid encodings use standard MIME type (IANA media types) naming conventions, such as the following:
-
text/plain -
application/json -
application/xml -
application/octet-stream
9.13.3. SYNOPSIS Copy linkLink copied to clipboard!
encoding ['ENCODING']
9.13.4. EXAMPLE Copy linkLink copied to clipboard!
encoding application/json
Configures the currently selected cache to encode entries as application/json.
9.13.5. SEE ALSO Copy linkLink copied to clipboard!
get(1), put(1)
9.14. GET(1) Copy linkLink copied to clipboard!
9.14.1. NAME Copy linkLink copied to clipboard!
get - retrieves entries from a cache.
9.14.2. SYNOPSIS Copy linkLink copied to clipboard!
get ['OPTIONS'] KEY
9.14.3. OPTIONS Copy linkLink copied to clipboard!
- -c, --cache='NAME'
- Specifies the cache from which to retrieve entries. Defaults to the currently selected cache.
9.14.4. EXAMPLE Copy linkLink copied to clipboard!
get hello -c mycache
Retrieves the value of the key named hello from mycache.
9.14.5. SEE ALSO Copy linkLink copied to clipboard!
query(1), put(1)
9.15. HELP(1) Copy linkLink copied to clipboard!
9.15.1. NAME Copy linkLink copied to clipboard!
help - prints manual pages for commands.
9.15.2. SYNOPSIS Copy linkLink copied to clipboard!
help ['COMMAND']
9.15.3. EXAMPLE Copy linkLink copied to clipboard!
help get
Prints the manual page for the get command.
9.15.4. SEE ALSO Copy linkLink copied to clipboard!
version(1)
9.16. LS(1) Copy linkLink copied to clipboard!
9.16.1. NAME Copy linkLink copied to clipboard!
ls - lists resources for the current path or a given path.
9.16.2. SYNOPSIS Copy linkLink copied to clipboard!
ls ['PATH']
9.16.3. EXAMPLES Copy linkLink copied to clipboard!
ls caches
Lists the available caches.
ls ../
Lists parent resources.
9.16.4. SEE ALSO Copy linkLink copied to clipboard!
cd(1)
9.17. PATCH(1) Copy linkLink copied to clipboard!
9.17.1. NAME Copy linkLink copied to clipboard!
patch - manages server patches.
9.17.2. DESCRIPTION Copy linkLink copied to clipboard!
List, describe, install, rollback, and create server patches.
Patches are zip archive files that contain artifacts to upgrade servers and resolve issues or add new features. Patches can apply target versions to multiple server installations with different versions.
9.17.3. SYNOPSIS Copy linkLink copied to clipboard!
patch ls
patch install 'patch-file'
patch describe 'patch-file'
patch rollback
patch create 'patch-file' 'target-server' 'source-server-1' ['source-server-2'…]
9.17.4. PATCH LIST OPTIONS Copy linkLink copied to clipboard!
- --server='path/to/server'
- Sets the path to a target server outside the current server home directory.
- -v, --verbose
- Shows the content of each installed patch, including information about individual files.
9.17.5. PATCH INSTALL OPTIONS Copy linkLink copied to clipboard!
- --dry-run
- Shows the operations that the patch peforms without applying any changes.
- --server='path/to/server'
- Sets the path to a target server outside the current server home directory.
9.17.6. PATCH DESCRIBE OPTIONS Copy linkLink copied to clipboard!
- -v, --verbose
- Shows the content of the patch, including information about individual files
9.17.7. PATCH ROLLBACK OPTIONS Copy linkLink copied to clipboard!
- --dry-run
- Shows the operations that the patch peforms without applying any changes.
- --server='path/to/server'
- Sets the path to a target server outside the current server home directory.
9.17.8. PATCH CREATE OPTIONS Copy linkLink copied to clipboard!
- -q, --qualifier='name'
- Specifies a descriptive qualifier string for the patch; for example, 'one-off for issue nnnn'.
9.17.9. EXAMPLES Copy linkLink copied to clipboard!
patch ls
Lists the patches currently installed on a server in order of installation.
patch install mypatch.zip
Installs "mypatch.zip" on a server in the current directory.
patch install mypatch.zip --server=/path/to/server/home
Installs "mypatch.zip" on a server in a different directory.
patch describe mypatch.zip
Displays the target version and list of source versions for "mypatch.zip".
patch create mypatch.zip 'target-server' 'source-server-1' ['source-server-2'…]
Creates a patch file named "mypatch.zip" that uses the version of the target server and applies to the source server versions.
patch rollback
Rolls back the last patch that was applied to a server and restores the previous version.
9.18. PUT(1) Copy linkLink copied to clipboard!
9.18.1. NAME Copy linkLink copied to clipboard!
put - adds or updates cache entries.
9.18.2. DESCRIPTION Copy linkLink copied to clipboard!
Creates entries for new keys. Replaces values for existing keys.
9.18.3. SYNOPSIS Copy linkLink copied to clipboard!
put ['OPTIONS'] KEY [VALUE]
9.18.4. OPTIONS Copy linkLink copied to clipboard!
- -c, --cache='NAME'
- Specifies the name of the cache. Defaults to the currently selected cache.
- -e, --encoding='ENCODING'
- Sets the media type for the value.
- -f, --file='FILE'
- Specifies a file that contains the value for the entry.
- -l, --ttl='TTL'
-
Sets the number of seconds before the entry is automatically deleted (time-to-live). Defaults to the value for
lifespanin the cache configuration if0or not specified. If you set a negative value, the entry is never deleted. - -i, --max-idle='MAXIDLE'
-
Sets the number of seconds that the entry can be idle. If a read or write operation does not occur for an entry after the maximum idle time elapses, the entry is automatically deleted. Defaults to the value for
maxIdlein the cache configuration if0or not specified. If you set a negative value, the entry is never deleted. - -a, --if-absent=[true|false]
- Puts an entry only if it does not exist.
9.18.5. EXAMPLES Copy linkLink copied to clipboard!
put -c mycache hello world
Adds the hello key with a value of world to the mycache cache.
put -c mycache -f myfile -i 500 hola
Adds the hola key with the value from the contents of myfile. Also sets a maximum idle of 500 seconds.
9.18.6. SEE ALSO Copy linkLink copied to clipboard!
get(1), remove(1)
9.19. QUERY(1) Copy linkLink copied to clipboard!
9.19.1. NAME Copy linkLink copied to clipboard!
query - retrieves entries that match Ickle query strings.
9.19.2. SYNOPSIS Copy linkLink copied to clipboard!
query ['OPTIONS'] QUERY_STRING
9.19.3. OPTIONS Copy linkLink copied to clipboard!
- -c, --cache='NAME'
- Specifies the cache to query. Defaults to the currently selected cache.
- --max-results='MAX_RESULTS'
-
Sets the number of results to return. The default is
10. - -o, --offset='OFFSET'
-
Specifies the index of the first result to return. The default is
0. - --query-mode='QUERY_MODE'
-
Specifies how the server executes the query. Values are
FETCHand BROADCAST. The default isFETCH.
9.19.4. EXAMPLES Copy linkLink copied to clipboard!
query "from org.infinispan.rest.search.entity.Person p where p.gender = 'MALE'"
Queries the currently selected cache to return entries from a Protobuf Person entity where the gender datatype is MALE.
9.19.5. SEE ALSO Copy linkLink copied to clipboard!
schema(1)
9.20. QUIT(1) Copy linkLink copied to clipboard!
9.20.1. NAME Copy linkLink copied to clipboard!
quit - exits the command line interface.
9.20.2. SYNOPSIS Copy linkLink copied to clipboard!
quit
9.20.3. EXAMPLE Copy linkLink copied to clipboard!
quit
Exits the CLI.
9.20.4. SEE ALSO Copy linkLink copied to clipboard!
disconnect(1), shutdown(1)
9.21. REMOVE(1) Copy linkLink copied to clipboard!
9.21.1. NAME Copy linkLink copied to clipboard!
remove - deletes entries from a cache.
9.21.2. SYNOPSIS Copy linkLink copied to clipboard!
remove KEY ['OPTIONS']
9.21.3. OPTIONS Copy linkLink copied to clipboard!
- --cache='NAME'
- Specifies the cache from which to remove entries. Defaults to the currently selected cache.
9.21.4. EXAMPLE Copy linkLink copied to clipboard!
remove --cache=mycache hola
Deletes the hola entry from the mycache cache.
9.21.5. SEE ALSO Copy linkLink copied to clipboard!
cache(1), drop(1), clearcache(1)
9.22. RESET(1) Copy linkLink copied to clipboard!
9.22.1. NAME Copy linkLink copied to clipboard!
reset - restores the initial values of counters.
9.22.2. SYNOPSIS Copy linkLink copied to clipboard!
reset ['COUNTER_NAME']
9.22.3. EXAMPLE Copy linkLink copied to clipboard!
reset cnt_a
Resets the cnt_a counter.
9.22.4. SEE ALSO Copy linkLink copied to clipboard!
add(1), cas(1), drop(1)
9.23. SCHEMA(1) Copy linkLink copied to clipboard!
9.23.1. NAME Copy linkLink copied to clipboard!
schema - uploads and registers protobuf schemas.
9.23.2. SYNOPSIS Copy linkLink copied to clipboard!
schema ['OPTIONS'] SCHEMA_NAME
9.23.3. OPTIONS Copy linkLink copied to clipboard!
- -u, --upload='FILE'
- Uploads a file as a protobuf schema with the given name.
9.23.4. EXAMPLE Copy linkLink copied to clipboard!
schema --upload=person.proto person.proto
Registers a person.proto Protobuf schema.
9.23.5. SEE ALSO Copy linkLink copied to clipboard!
query(1)
9.24. SHUTDOWN(1) Copy linkLink copied to clipboard!
9.24.1. NAME Copy linkLink copied to clipboard!
shutdown - stops individual servers or performs orderly shutdowns for entire clusters.
9.24.2. SYNOPSIS Copy linkLink copied to clipboard!
shutdown server ['SERVERS']
shutdown cluster
9.24.3. EXAMPLES Copy linkLink copied to clipboard!
shutdown server my_server01
Stops the server with hostname my_server01.
shutdown cluster
Performs an orderly shutdown of all servers joined to the cluster.
9.24.4. SEE ALSO Copy linkLink copied to clipboard!
connect(1), disconnect(1), quit(1)
9.25. SITE(1) Copy linkLink copied to clipboard!
9.25.1. NAME Copy linkLink copied to clipboard!
site - manages backup locations and performs cross-site replication operations.
9.25.2. SYNOPSIS Copy linkLink copied to clipboard!
site status ['OPTIONS']
site bring-online ['OPTIONS']
site take-offline ['OPTIONS']
site push-site-state ['OPTIONS']
site cancel-push-state ['OPTIONS']
site cancel-receive-state ['OPTIONS']
site push-site-status ['OPTIONS']
9.25.3. OPTIONS Copy linkLink copied to clipboard!
- --cache='CACHE_NAME'
- Specifies a cache.
- --site='SITE_NAME'
- Specifies a backup location.
9.25.4. EXAMPLES Copy linkLink copied to clipboard!
site status --cache=mycache
Returns the status of all backup locations for mycache.
site status --cache=mycache --site=NYC
Returns the status of NYC for mycache.
site bring-online --cache=mycache --site=NYC
Brings the site NYC online for mycache.
site take-offline --cache=mycache --site=NYC
Takes the site NYC offline for mycache.
site push-site-state --cache=mycache --site=NYC
Backs up caches to remote backup locations.
site push-site-status --cache=mycache
Displays the status of the operation to backup mycache.
site cancel-push-state --cache=mycache --site=NYC
Cancels the operation to backup mycache to NYC.
site cancel-receive-state --cache=mycache --site=NYC
Cancels the operation to receive state from NYC.
site clear-push-state-status --cache=myCache
Clears the status of the push state operation for mycache.
9.26. TASK(1) Copy linkLink copied to clipboard!
9.26.1. NAME Copy linkLink copied to clipboard!
task - executes and uploads server-side tasks and scripts
9.26.2. SYNOPSIS Copy linkLink copied to clipboard!
task upload --file='script' 'TASK_NAME'
task exec ['TASK_NAME']
9.26.3. EXAMPLES Copy linkLink copied to clipboard!
task upload --file=hello.js hello
Uploads a script from a hello.js file and names it hello.
task exec @@cache@names
Runs a task that returns available cache names.
task exec hello -Pgreetee=world
Runs a script named hello and specifies the greetee parameter with a value of world.
9.26.4. OPTIONS Copy linkLink copied to clipboard!
- -P, --parameters='PARAMETERS'
- Passes parameter values to tasks and scripts.
- -f, --file='FILE'
- Uploads script files with the given names.
9.26.5. SEE ALSO Copy linkLink copied to clipboard!
ls(1)
9.27. VERSION(1) Copy linkLink copied to clipboard!
9.27.1. NAME Copy linkLink copied to clipboard!
version - displays the server version and CLI version.
9.27.2. SYNOPSIS Copy linkLink copied to clipboard!
version
9.27.3. EXAMPLE Copy linkLink copied to clipboard!
version
Returns the version for the server and the CLI.
9.27.4. SEE ALSO Copy linkLink copied to clipboard!
help(1)