BRIX On-Premises > Prepare infrastructure > Databases > Prepare external databases / Redis

Redis

For the proper functioning of the system, Redis version 5 or 6.2 is required. The article describes the installation of Redis 6.2.12 for Ubuntu Linux 20.04 and 22.04. You can also refer to the guide in the official Redis documentation.

Installation consists of three steps:

  1. Install Redis.
  2. Configure Redis.
  3. Connect to Redis.

Step 1: Install Redis

  1. Install the necessary packages:

sudo apt install lsb-release curl gpg

  1. Import the necessary keys and add the Redis repository:

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

  1. Update the package cache:

sudo apt-get update

  1. Install Redis:

sudo apt-get -y install redis=6:6.2.12-1rl1~$(lsb_release -cs)1 redis-server=6:6.2.12-1rl1~$(lsb_release -cs)1 redis-tools=6:6.2.12-1rl1~$(lsb_release -cs)1

Step 2: Configure Redis

Начало внимание

The password can contain the following characters:

  • Uppercase Latin letters: A to Z
  • Lowercase Latin letters: a to z
  • Digits: 0 to 9
  • Symbols: -_

Reserved (invalid) characters: ! * ' ( ) ; : @ & = + $ , / ? % # [ ]

Конец внимание

  1. Allow connection to the Redis server. To do this, edit the /etc/redis/redis.conf configuration file and add the machine's IP address (e.g., 192.168.10.10):

sudo nano /etc/redis/redis.conf
bind 192.168.10.10

Configuring TLS/SSL in Redis

  1. Increase the maximum number of clients by changing the value of the parameter maxclients to 20000. Uncomment the line by removing the # sign:

maxclients 20000

  1. Set the key eviction policy by changing the value of the parameter maxmemory-policy to allkeys-lfu. Uncomment the line by removing the # sign:

maxmemory-policy allkeys-lfu

  1. Disable snapshot creation by changing the value of the parameter save to "". Uncomment the line by removing the # sign:

save ""

  1. Disable AOF (saving the Redis database to a file). To do this, change the value of the parameter appendonly to no. Uncomment the line, removing the # sign:

appendonly no

  1. Restart Redis:

sudo systemctl restart redis-server

Step 3: Connect to Redis

Connection string to Redis:

redis://<redis-server-address>:6379/0

Connection string to Redis with TLS/SSL:

redis://<redis-server-address>:6379/0

If you already have a Redis cluster, you can use it as a cache for BRIX. For information on deploying a Redis Cluster, refer to the official documentation.