Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 1. Getting Started with the Data Grid CLI
The command line interface (CLI) lets you remotely connect to Data Grid servers to access data and perform administrative functions.
1.1. Creating and Modifying Users Copier lienLien copié sur presse-papiers!
Data Grid Server requires users to authenticate against a default property realm. Before you can access Data Grid Server, you must add credentials by creating at least one user and a password. You can also add and modify the security authorization groups to which users belong.
Procedure
-
Open a terminal in
$RHDG_HOME. -
Create and modify Data Grid users with the
usercommand.
Run help user for more details about using the command.
Creating users and passwords
Linux
bin/cli.sh user create myuser -p "qwer1234!"
$ bin/cli.sh user create myuser -p "qwer1234!"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Microsoft Windows
bin\cli.bat user create myuser -p "qwer1234!"
$ bin\cli.bat user create myuser -p "qwer1234!"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Creating users with group membership
Linux
bin/cli.sh user create myuser -p "qwer1234!" -g supervisor,reader,writer
$ bin/cli.sh user create myuser -p "qwer1234!" -g supervisor,reader,writerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Microsoft Windows
bin\cli.bat user create myuser -p "qwer1234!" -g supervisor,reader,writer
$ bin\cli.bat user create myuser -p "qwer1234!" -g supervisor,reader,writerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2. Connecting to Data Grid Servers Copier lienLien copié sur presse-papiers!
Establish CLI connections to Data Grid.
Prerequisites
Add user credentials and have at least one running Data Grid server instance.
Procedure
-
Open a terminal in
$RHDG_HOME. Start the CLI.
Linux:
bin/cli.sh
$ bin/cli.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow Microsoft Windows:
bin\cli.bat
$ bin\cli.batCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
connectcommand and enter your username and password when prompted.Data Grid Server on the default port of
11222:[disconnected]> connect
[disconnected]> connectCopy to Clipboard Copied! Toggle word wrap Toggle overflow Data Grid Server with a port offset of
100:[disconnected]> connect 127.0.0.1:11322
[disconnected]> connect 127.0.0.1:11322Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4. Shutting Down Data Grid Server Copier lienLien copié sur presse-papiers!
Stop individually running servers or bring down clusters gracefully.
Procedure
- Create a CLI connection to Data Grid.
Shut down Data Grid Server in one of the following ways:
Stop all nodes in a cluster with the
shutdown clustercommand, for example:[//containers/default]> shutdown cluster
[//containers/default]> shutdown clusterCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command saves cluster state to the
datafolder for each node in the cluster. If you use a cache store, theshutdown clustercommand also persists all data in the cache.Stop individual server instances with the
shutdown servercommand and the server hostname, for example:[//containers/default]> shutdown server <my_server01>
[//containers/default]> shutdown server <my_server01>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The shutdown server command does not wait for rebalancing operations to complete, which can lead to data loss if you specify multiple hostnames at the same time.
Run help shutdown for more details about using the command.
Verification
Data Grid logs the following messages when you shut down servers:
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
1.4.1. Restarting Data Grid Clusters Copier lienLien copié sur presse-papiers!
When you bring Data Grid clusters back online after shutting them down, you should wait for the cluster to be available before adding or removing nodes or modifying cluster state.
If you shutdown clustered nodes with the shutdown server command, you must restart each server in reverse order.
For example, if you shutdown server1 and then shutdown server2, you should first start server2 and then start server1.
If you shutdown a cluster with the shutdown cluster command, clusters become fully operational only after all nodes rejoin.
You can restart nodes in any order but the cluster remains in DEGRADED state until all nodes that were joined before shutdown are running.