0
0
Redisquery~30 mins

Sentinel configuration in Redis - Mini Project: Build & Apply

Choose your learning style9 modes available
Redis Sentinel Configuration for High Availability
📖 Scenario: You are setting up a Redis system that needs to stay online even if the main Redis server fails. To do this, you will configure Redis Sentinel, which watches over Redis servers and helps switch to a backup if the main one stops working.
🎯 Goal: Build a basic Redis Sentinel configuration that monitors a Redis master server and is ready to handle failover automatically.
📋 What You'll Learn
Create a Redis master server configuration with a specific name and port
Set up a Sentinel configuration file that monitors the Redis master server
Configure the Sentinel with quorum and failover timeout settings
Add a notification script path to the Sentinel configuration
💡 Why This Matters
🌍 Real World
Redis Sentinel is used in real systems to keep Redis databases available even if the main server crashes, ensuring apps keep working without interruption.
💼 Career
Knowing how to configure Redis Sentinel is important for roles like DevOps engineers, backend developers, and system administrators who manage reliable data storage.
Progress0 / 4 steps
1
Create Redis master server configuration
Create a Redis configuration file named redis.conf with the following settings: set port 6379 and bind 127.0.0.1.
Redis
Need a hint?

Use two lines: one for port and one for bind.

2
Create Sentinel configuration to monitor master
Create a Sentinel configuration file named sentinel.conf and add a line to monitor the Redis master server with name mymaster, IP 127.0.0.1, and port 6379.
Redis
Need a hint?

The number 1 is the quorum for failover.

3
Configure Sentinel quorum and failover timeout
In sentinel.conf, add lines to set sentinel down-after-milliseconds mymaster 5000 and sentinel failover-timeout mymaster 10000.
Redis
Need a hint?

These settings tell Sentinel how long to wait before marking the master as down and how long to wait for failover.

4
Add notification script to Sentinel configuration
In sentinel.conf, add a line to set sentinel notification-script mymaster /path/to/notify.sh to run a notification script on events.
Redis
Need a hint?

This script will be called by Sentinel when important events happen.