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:
Step 1: Install Redis
- Install the necessary packages:
sudo apt install lsb-release curl gpg
- 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
- Update the package cache:
sudo apt-get update
- 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: ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
Конец внимание
- 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
To enable TLS/SSL support in Redis, in the configuration file
port 0 For more details on TLS/SSL configuration in Redis, refer to the official Redis documentation. |
- Increase the maximum number of clients by changing the value of the parameter
maxclients
to20000
. Uncomment the line by removing the # sign:
maxclients 20000
- Set the key eviction policy by changing the value of the parameter
maxmemory-policy
toallkeys-lfu
. Uncomment the line by removing the # sign:
maxmemory-policy allkeys-lfu
- Disable snapshot creation by changing the value of the parameter
save
to""
. Uncomment the line by removing the # sign:
save ""
- Disable AOF (saving the Redis database to a file). To do this, change the value of the parameter
appendonly
tono
. Uncomment the line, removing the # sign:
appendonly no
- 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.