搜索

此内容没有您所选择的语言版本。

Chapter 4. Configuring the Data Grid CLI

download PDF

Define configuration properties for the Data Grid CLI.

4.1. Setting Data Grid CLI Properties and Persistent Storage

Configure Data Grid CLI startup operations and customize the location for persistent storage.

Prerequisites

Create at least one Data Grid user.

Procedure

  1. Optionally set a custom path to the Data Grid CLI storage directory in one of the following ways:

    • Using the cli.dir system property:

      bin/cli.sh -Dcli.dir=/path/to/cli/storage ...
    • Using the ISPN_CLI_DIR environment variable:

      export ISPN_CLI_DIR=/path/to/cli/storage
      bin/cli.sh ...
  2. Set values for configuration properties with the config set command.

    For example, set the autoconnect-url property so that the CLI automatically connects to that URL.

    Note

    For 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
  3. Verify configuration properties with the config get command.

    Tip

    Run help config to 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

  1. Create aliases with the alias <alias>=<command> command.

    For example, set q as an alias for the quit command:

    alias q=quit
  2. Run the alias command to check the defined aliases.

    alias
    alias q='quit'
  3. Delete aliases with the unalias command, 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

  1. Specify the location of the server key store, as in the following example:

    bin/cli.sh config set truststore /home/user/my-trust-store.jks
  2. Optional: Define a trust store password. The following example sets secret as the trust store password:

    bin/cli.sh config set truststore-password secret
  3. Optional: 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>
  4. Optional: Define a key store password. The following example sets secret as the key store password:

    bin/cli.sh config set keystore-password secret
  5. Verify your CLI configuration.

    bin/cli.sh config get truststore
    bin/cli.sh config get truststore-password

4.4. Data Grid CLI Storage Directory

Data Grid CLI stores configuration in the following default directory:

Operating SystemDefault Path

Linux/Unix

$HOME/.config/red_hat_data_grid

Microsoft Windows

%APPDATA%/Sun/Java/red_hat_data_grid

Mac OS

$HOME/Library/Java/red_hat_data_grid

This directory contains the following files:

cli.properties
Stores values for CLI configuration properties.
aliases
Stores command aliases.
history
Stores CLI history.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.