Install Redis on Ubuntu
March 2024
A Redis database is required for ProCall DataCenter.
In the following instructions, we provide information on the procedure as an example to install Redis on Ubuntu 2204.
These instructions are intended as a guide and assume specialist knowledge.
Since Redis is not a product or service provided by estos, there is no claim to completeness and correct description.
Procedure
Installation
Ubuntu2204
sudo apt update
Install Redis
sudo apt install redis-server
Check Redis version
redis-server --version
Configuration
Edit config
sudo nano /etc/redis/redis.conf
The following items must be set:
Binding the network address
This is used to configure which IP address the Redis service should "listen" to. The configured network address must then be entered in UCServer Administration.
bind <ip-addr>
Example screenshot redis.conf
Port
This can be used to configure the port via which the service can be reached. By default, this is "6379". The configured port must then be entered in the UCServer administration;
port <port>
Protection mode
The "protected mode" is activated by default. This means that the Redis service cannot be reached by another host until a password (see "requirepass") has been set. If the Redis service is to be accessed by another host without a password, the value must be set to "no";
protected-mode <value> (yes/no)
Password protection
Access to the Redis service can be protected by a password. The configured password must then be entered in UCServer Administration;
requirepass <password>
Start service
Restart Redis
sudo systemctl restart redis.service
Check whether Redis service is running
sudo systemctl status redis
Example screenshot for the display
Redis is now ready for use and can be connected in the ProCall DataCenter UCServer.
Redundancy through Redis network
Redis Sentinel is supported in order to design the Redis backend redundantly and thus achieve a higher degree of reliability. The use of Redis Sentinel is based on the configuration of Redis Replicas.
Recommendation
The Sentinel instances, as well as the Redis Server instances, should be placed on computers or virtual machines that are assumed to fail independently of each other. For example, different physical servers or virtual machines running in different availability zones. For a stable deployment, you need at least three Sentinel instances, just like the Redis Server instances.
Redis Replica
Anleitung
You can find the complete Redis replication guide here: https://redis.io/docs/management/replication/
The Redis master is configured via redis.conf as described above. The replicas are also configured via redis.conf. Replication takes place via the Redis service and does not need to be started separately. When configuring the replicas, make sure that the port and password used correspond to those of the master configuration;
The following configuration settings must also be made on the replica side:
Specification of the master
The replica must be informed of the IP and port of the master instance via which it can reach the master;
replicaof <ip> <port>
Password of the master
If the master is protected with a password, the password of the master must be entered here. The Redis Replica should have the same password set in the "requirepass" parameter as the master password in order to support a master change;
masterauth <password>
Using Docker
Recommendation
If you use Redis Replication in conjunction with Docker, please note that additional configuration parameters may need to be specified. Please consult the official Redis Sentinel documentation;
Redis Sentinel
Anleitung
The complete Redis Sentinel manual can be found here: https://redis.io/docs/management/sentinel/
Configuration
Port
This can be used to configure the port via which the service can be reached. By default, this is "26379". The configured port must then be entered in the UCServer administration;
port <sentinel-port>
Definition of the master to be monitored
This is used to configure which Redis master the Sentinel service should monitor. The <master-name> can be freely assigned. The configured name must then be entered in UCServer Administration. Furthermore, the IP and port of the Redis master must be entered under which it can be reached. A "quorum" must also be defined for error detection. This is the number of Redis Sentinel instances that must agree that the Redis master instance can no longer be reached. A majority of the Sentinel instances is always required for the actual troubleshooting, i.e. the election of a replica as the new master. This cannot be configured;
sentinel monitor <master-name> <ip> <redis-port> <quorum>
Password of the Redis Master and the Redis Replicas
In order for Redis Sentinel to communicate with the Redis master, the Sentinel service must know the master's password;
sentinel auth-pass <master-name> <password>
The master and its replicas must use the same password.
Sentinel Passwort
Sentinel Password
Currently, setting a password for Redis Sentinel is not supported.
The Sentinel service can be protected by a password. All Sentinel services that need to communicate with each other must use the same password;
requirepass <password>
Definition of the downtime for failure detection
This can be used to define how long a master may take for a response before it is recognized as failed. The default value is 30000 ms. The name specified under "sentinel monitor" should be used as the master name.
sentinel down-after-milliseconds <master-name> <milliseconds>
Definition of parallel re-synchronizations
The parameter defines how many replicas may synchronize against the newly selected master in parallel. This parameter should be set to a low value, especially if the replicas are used by the Redis clients for read purposes. As the data is only read from the master in this context, this value can be set high. It can include the complete number of existing replicas. The name specified under "sentinel monitor" should be used as the master name.
sentinel parallel-syncs <master-name> <numreplicas>
Definition of downtime
The specified time is used for many purposes (see sentinel.conf for more information). The default value is 180000ms, i.e. 3 minutes. The name specified under "sentinel monitor" is to be used as the master name.
sentinel failover-timeout <master-name> <milliseconds>
Use of Docker
Recommendation
If you use Redis Sentinel in conjunction with Docker, please note that additional configuration parameters may need to be specified. Please consult the official Redis Sentinel documentation;
Start service
The service is started by the following call:
redis-sentinel /path/to/sentinel.conf