此内容没有您所选择的语言版本。
Chapter 4. Configuring the Data Grid CLI
Define configuration properties for the Data Grid CLI.
Configure Data Grid CLI startup operations and customize the location for persistent storage.
Prerequisites
Create at least one Data Grid user.
Procedure
Optionally set a custom path to the Data Grid CLI storage directory in one of the following ways:
Using the
cli.dirsystem property:bin/cli.sh -Dcli.dir=/path/to/cli/storage ...Using the
ISPN_CLI_DIRenvironment variable:export ISPN_CLI_DIR=/path/to/cli/storage bin/cli.sh ...
Set values for configuration properties with the
config setcommand.For example, set the
autoconnect-urlproperty so that the CLI automatically connects to that URL.NoteFor remote connections, specify the URL and provide credentials:
-
http[s]://<username>:<password>@<hostname>:<port>for basic authentication. -
http[s]://<token>@<hostname>:<port>for OAuth authentication.
bin/cli.sh config set autoconnect-url http://<username>:<password>@<hostname>:11222-
Verify configuration properties with the
config getcommand.TipRun
help configto review available configuration properties and get example usage.
4.2. Creating Command Aliases 复制链接链接已复制到粘贴板!
Create aliases for Data Grid CLI commands to define custom shortcuts.
Procedure
Create aliases with the
alias <alias>=<command>command.For example, set
qas an alias for thequitcommand:alias q=quitRun the
aliascommand to check the defined aliases.alias alias q='quit'Delete aliases with the
unaliascommand, for example:unalias q
4.3. Trusting Data Grid Server Connections 复制链接链接已复制到粘贴板!
Secure Data Grid CLI connections to Data Grid Server with SSL/TLS certificates. If you create a key store as an SSL identity for Data Grid Server, the CLI can validate server certificates to verify the identity.
Prerequisites
- Set up an SSL identity for Data Grid Server.
- Create at least one Data Grid user.
Procedure
Specify the location of the server key store, as in the following example:
bin/cli.sh config set truststore /home/user/my-trust-store.jksOptional: Define a trust store password. The following example sets
secretas the trust store password:bin/cli.sh config set truststore-password secretOptional: If you require client certificate authentication for your server, specify the location of the client key store. Considering the following example, replace
<path>with the absolute directory path to your key store file, and replace<key_store_file>with the name of your key store file:bin/cli.sh config set keystore /<emphasis><path></emphasis>/<emphasis><key_store_file></emphasis>Optional: Define a key store password. The following example sets
secretas the key store password:bin/cli.sh config set keystore-password secretVerify your CLI configuration.
bin/cli.sh config get truststorebin/cli.sh config get truststore-password
4.4. Data Grid CLI Storage Directory 复制链接链接已复制到粘贴板!
Data Grid CLI stores configuration in the following default directory:
| Operating System | Default Path |
|---|---|
| Linux/Unix |
|
| Microsoft Windows |
|
| Mac OS |
|
This directory contains the following files:
cli.properties- Stores values for CLI configuration properties.
aliases- Stores command aliases.
history- Stores CLI history.