13.3. Creating remote caches with the Data Grid CLI
Use the Data Grid Command Line Interface (CLI) to add remote caches on Data Grid Server.
Prerequisites
-
Create a Data Grid user with
adminpermissions. - Start at least one Data Grid Server instance.
- Have a Data Grid cache configuration.
Procedure
Start the CLI.
bin/cli.sh-
Run the
connectcommand and enter your username and password when prompted. Use the
create cachecommand to create remote caches.For example, create a distributed cache named "distcache" as follows:
create cache distcache "<distributed-cache />"
You can use any configuration format supported by Data Grid. Create a cache using a JSON configuration as follows:
+
create cache json '{"distributed-cache":{"mode":"SYNC"}}'
It is possible to use a configuration stored in an external file. For example, create a cache named "mycache" from a file named mycache.xml as follows:
+
create cache --file=mycache.xml mycache
Verification
List all remote caches with the
lscommand.ls caches mycacheView cache configuration with the
describecommand.describe caches/mycache