2021-01-29 15:05:00 +00:00
[id='creating-infinispan-caches-{context}']
= Creating Infinispan Caches
Create the Infinispan caches that {project_name} requires.
We recommend that you create caches on {jdgserver_name} clusters at runtime rather than adding caches to `infinispan.xml`.
This strategy ensures that your caches are automatically synchronized across the cluster and permanently stored.
The following procedure uses the {jdgserver_name} Command Line Interface (CLI) to create all the required caches in a single batch command.
.Prerequisites
* Configure your {jdgserver_name} clusters.
.Procedure
. Create a batch file that contains caches, for example:
+
[source,bash,options="nowrap",subs=attributes+]
-----
cat > /tmp/caches.batch<<EOF
echo "creating caches..."
create cache work --template=sessions-cfg
create cache sessions --template=sessions-cfg
create cache clientSessions --template=sessions-cfg
create cache offlineSessions --template=sessions-cfg
create cache offlineClientSessions --template=sessions-cfg
create cache actionTokens --template=sessions-cfg
create cache loginFailures --template=sessions-cfg
echo "verifying caches"
ls caches
EOF
-----
+
. Create the caches with the CLI.
+
[source,bash,options="nowrap",subs=attributes+]
-----
2021-01-29 20:47:47 +00:00
$ bin/cli.sh -c https://server1:11222 --trustall -f /tmp/caches.batch
2021-01-29 15:05:00 +00:00
-----
2021-01-29 20:47:47 +00:00
+
NOTE: Instead of the `--trustall` argument you can specify the truststore with the `-t` argument and the truststore password with the `-s` argument.
+
. Create the caches on the other site.
2021-01-29 15:05:00 +00:00
ifeval::[{project_product}==true]
[role="_additional-resources"]
.Additional resources
link:https://access.redhat.com/documentation/en-us/red_hat_data_grid/8.1/html-single/data_grid_server_guide/index#start_server[Getting Started with Data Grid Server] +
link:https://access.redhat.com/documentation/en-us/red_hat_data_grid/8.1/html-single/data_grid_server_guide/index#create_remote_cache[Remotely Creating Caches on Data Grid Clusters] +
2021-01-29 20:47:47 +00:00
link:https://access.redhat.com/documentation/en-us/red_hat_data_grid/8.1/html-single/data_grid_command_line_interface/index#batch_operations[Performing Batch Operations with the CLI]
2021-01-29 15:05:00 +00:00
endif::[]