- Contrast Documentation
- System Administration
- Post-installation
- Use Redis as a shared cache (on-premises)
Use Redis as a shared cache (on-premises)
You can configure Contrast to use a shared cache on a Redis server.
This topic does not provide details about setting up Redis servers.
Contrast properties for Redis
Use these properties:
Property name | Description |
---|---|
| A Boolean value indicating whether Contrast uses Redis for caches. |
| An Integer specifying the database index where Contrast stores cache information. |
| A string that controls which protocol to use when Contrast connects to the Redis server. |
| A string containing the host name or IP address of the Redis server. |
| An Integer representing the TCP/IP port that the Redis server uses using to listen for new client connections. |
| A string containing the password used to authorize client access to the Redis server. |
| A string that identifies the client. |
Before you begin
You need this information:
The host name or IP address for the Redis server
The listening port for the Redis server
The password for a user account on the Redis server
The database index that the cache should target
Verify that the Redis server is configured to use TLS (REDISS)
Steps
Create a
contrast.properties
file in the/data/conf/
folder.Ensure this file has the correct permissions to let a
contrast_server
user access it.In the property file, add the Contrast properties for Redis.
At a minimum, configure values for the host name, listening port, and password for the Redis server.
Property file example:
cache.useredis=true contrast.cache.redis.db.index=0 contrast.cache.redis.proto=rediss contrast.cache.redis.host=contrast-redis-server.company.com contrast.cache.redis.port=6379 contrast.cache.redis.password=changeme contrast.cache.redis.client.name=contrast
To verify the configuration look in the
/data/logs/contrast.log
file.This file contains all the information on the current configuration and interactions with Redis. Key terms to look for include:
RedissonCache
Redisson
CacheConfiguration