Configure Caching for Deploy Cluster Setup
Note: Active-Hot-standby mode is not supported for caching setup.
You must perform these steps on all Deploy master servers in the cluster but not on the workers.
-
Set the
in-process-worker
key tofalse
(default value istrue
) in thedeploy-task.yaml
file. -
Set the
cluster.mode
key tofull
in thedeploy-cluster.yaml
file for_Active-Active_ cluster. -
Edit the
deploy-caches.yaml
file.- Set the
deploy.caches.enabled
key totrue
(default value isfalse
) in thedeploy-caches.yaml file
to enable application-level caching. - Type the name of the properties file (
infinispan-hotrod.properties
) in theprovider-configuration-file
key. - Type the name of the cache provider in the
provider-configuration.provider
key. For example,org.infinispan.jcache.remote.JCachingProvider
.
- Set the
-
Optionally, you can configure the following individual caches in the
deploy-caches.yaml
file.Cache Description CI_PK_CACHE Cache for CIs by primary keys CI_PATH_CACHE Cache for CIs by their paths CI_PROPERTIES_CACHE Cache for CI properties LICENSE_CI_COUNT Cache for license restricted CI counts See deploy-caches.yaml file's configuration properties page for more information.
Here is an example
deploy-caches.yaml
file used to enable distributed caching on Deploy cluster setups: -
Add the following circuit-breaker configuration to the
infinispan-hotrod.properties
file to handle situations when the Infinispan server is down:
infinispan.client.hotrod.connect_timeout=5000
infinispan.client.hotrod.max_retries=1
-
Download and set up the Infinispan cache manager using one of the following options:
-
After starting the Infinispan server, ensure that the Infinispan console is accessible at
http://localhost:11222
. -
Using the sample pom.xml file, download the
infinispan-jcache-remote 14.0.17
jar file with all its transitive dependencies, and copy the downloaded files to the/lib
directory of all Deploy masters and workers.mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies -f pom.xml -DoutputDirectory=$deployserver/lib
Note:
$deployserver
is the Deploy installation directory. -
Download the
infinispan-hotrod.properties
file and place it in the/conf
directory of all Deploy masters and workers. -
Ensure that the
infinispan-hotrod.properties
file contains the correct credentials for Infinispan server console and that it is placed in the/conf
directory of all masters and workers.Notes:
- Make sure that the cache names mentioned in the
infinispan-hotrod.properties
file match with the default cache names (CI_PK_CACHE, CI_PATH_CACHE, and CI_PROPERTIES_CACHE). - Ensure that all CI caches (CI_PK_CACHE, CI_PATH_CACHE, and CI_PROPERTIES_CACHE) are enabled or disabled together.
- Some properties such as
ttl-minutes
in thedeploy-caches.yaml
file exist under a different name (expiration lifespan
) in theinfinispan-hotrod.properties
file. In such cases, the value provided in theinfinispan-hotrod.properties
file takes the higher precedence.
- Make sure that the cache names mentioned in the
-
Check the logs to ensure that the cache configuration is correct.
Notes:
- Any failure during the caching setup will be captured in the logs but will not stop the application from starting.
- Verify that the cache manager is successfully created in the node before moving on to setup next master or worker node.
Troubleshooting
In case of any issues or unexpected behavior with the Deploy cache, check the logs for possible configuration issues such as the one shown below.
In such cases, correct the appropriate configuration parameter, restart the server and check the logs again.