此内容没有您所选择的语言版本。
Chapter 2. 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.
Prerequisites
- At least one running Data Grid server.
2.1. Starting the Data Grid CLI 复制链接链接已复制到粘贴板!
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 复制链接链接已复制到粘贴板!
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 复制链接链接已复制到粘贴板!
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 复制链接链接已复制到粘贴板!
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