Redis Sentinel is a dedicated process to automate and simplify the Redis replication failover and switchover.

In this article, we will start with 3 Nodes. We will have two Redis instances on two different nodes – 1 master and 1 replica (or slave). Sentinel will be co-located on those 2 nodes, plus an additional node on one of our web servers.

Normally you would co-locate a Redis instance on the web/application server and access it via localhost or through a UNIX socket file. This is the straightforward way to incorporate Redis into the application.

Read More

In order to get the latest version of Redis, we will use apt to install it from the official Ubuntu repositories.

Update your local apt package cache and install Redis by typing:

$ sudo apt update
$ sudo apt install redis-server

This will download and install Redis and its dependencies.

If on A regular Ubuntu distribution, change the configuration for the server to run as a service.

Open this file with your preferred text editor:

$ sudo nano /etc/redis/redis.conf

Change the following:

supervised no

Change as below.

supervised systemd

Restart

# sudo systemctl restart redis.service

On WSL ubuntu:

sudo /etc/init.d/redis-server restart

Start by checking that the Redis service is running:

$ sudo systemctl status redis

on WSL ubuntu

$ sudo /etc/init.d/redis-server status
* redis-server is running

To test that Redis is functioning correctly, connect to the server using the command-line client:

$ redis-cli

In the prompt that follows, test connectivity with the ping command:

127.0.0.1:6379>ping
PONG