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.
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
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.
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
An authenticated TLS CLI session opens.
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.
ROLE
INFO replication
INFO persistence
QUIT
Check the role, exact values and required responses described above; stop on any unexpected result.
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.
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
Application identity opens without administrative privileges.
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.
SET academy:probe before-failover
WAIT 2 5000
GET academy:probe
QUIT
Illustrative successful output / نمونهٔ خروجی موفق:
OK
(integer) 2
"before-failover"Check the role, exact values and required responses described above; stop on any unexpected result.
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.
GET academy:probe
SET academy:probe forbidden-write
QUIT
Check the role, exact values and required responses described above; stop on any unexpected result.
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.
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
Three distinct voters discover each other without authentication or rewrite errors.