← Start of tutorial

WIUNIX ACADEMY

Set up Redis Sentinel high availability on Ubuntu and Debian

Page 4 of 7. Review the earlier steps and prerequisites before continuing.

YOUR SYSTEM. YOUR STEPS.

Where are you working?

Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.

Ubuntu 26.10Reviewed against official documentation ·

USE YOUR OWN VALUES

Configure this tutorial

Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.

Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.

Set values for my environment5 editable values
11

LET’S BUILD

Inspect actual replication as the administrator

On A/B/C locally, enter the ADMIN secret at the hidden prompt. Do not put it in argv or shell history. The next panel is an interactive redis-cli session; commands there are not shell commands.

Bash
sudo redis-cli --tls --cacert /etc/redis/tls/ca.pem --cert /etc/redis/tls/node.pem --key /etc/redis/tls/node.key -h 127.0.0.1 -p 6379 --user admin --askpass
How do I know it worked?

An authenticated TLS CLI session opens.

12

LET’S BUILD

Check roles, link state and receiver progress

On A expect role:master and connected_slaves:2. On B/C expect role:slave, master_host 10.20.0.10, master_link_status:up and master_sync_in_progress:0. Compare advancing offsets under writes; an up link alone does not prove the expected data arrived. Redis output retains legacy master/slave field names. Persistence status should show successful RDB/AOF operations, not recurring errors.

Redis CLI
ROLE
INFO replication
INFO persistence
QUIT
How do I know it worked?

Check the role, exact values and required responses described above; stop on any unexpected result.

13

LET’S BUILD

Open one application connection to A

On A locally, APP secret at the prompt. This deliberately narrow lab user can only read/write academy:*, use WAIT and check health/role. It is not a generic production application ACL. Keep this SAME connection for SET then WAIT.

Bash
sudo redis-cli --tls --cacert /etc/redis/tls/ca.pem --cert /etc/redis/tls/node.pem --key /etc/redis/tls/node.key -h 127.0.0.1 -p 6379 --user app --askpass
How do I know it worked?

Application identity opens without administrative privileges.

14

LET’S BUILD

Write a marker and check two replica acknowledgements

In that APP session. SET must return OK. WAIT 2 should return 2 within 5 s;0/1 is an incomplete replication check, not success. Stop the rehearsal if it is short. Even 2 is not a durable consensus guarantee. This marker belongs to the dedicated lab only.

Redis CLI
SET academy:probe before-failover
WAIT 2 5000
GET academy:probe
QUIT
EXAMPLE OUTPUT
Illustrative successful output / نمونهٔ خروجی موفق:
OK
(integer) 2
"before-failover"
How do I know it worked?

Check the role, exact values and required responses described above; stop on any unexpected result.

15

LET’S BUILD

Read the receiver data and prove write rejection

On B and C, use the APP login panel locally, then the following session. GET must equal before-failover on EACH receiver. The attempted SET is expected to return READONLY; it must not change the marker. A stale-data refusal during disconnection is intentional. Do not enable replica writes to hide this result.

Redis CLI
GET academy:probe
SET academy:probe forbidden-write
QUIT
How do I know it worked?

Check the role, exact values and required responses described above; stop on any unexpected result.

16

LET’S BUILD

Start voters one at a time

On A, then B, then C; wait 30 s between adding each voter and check logs before proceeding. This pause supports discovery, not an availability promise. No new unit or shared service is needed.

Bash
sudo systemctl enable --now redis-sentinel
sudo systemctl status redis-sentinel --no-pager
sleep 30
sudo tail -n 40 /var/log/redis/redis-sentinel.log
How do I know it worked?

Three distinct voters discover each other without authentication or rewrite errors.

Explore all tutorials ↗