0
0
Redisquery~30 mins

Monitoring with Sentinel in Redis - Mini Project: Build & Apply

Choose your learning style9 modes available
Monitoring with Sentinel
📖 Scenario: You are managing a Redis database that needs to be highly available. To do this, you will set up Redis Sentinel to monitor the Redis master and its replicas. Sentinel will help detect failures and promote a replica to master if needed.
🎯 Goal: Set up a basic Redis Sentinel configuration to monitor a Redis master instance. You will create the initial Sentinel configuration, add monitoring settings, and then check the Sentinel output to confirm it is monitoring the master.
📋 What You'll Learn
Create a Redis Sentinel configuration file named sentinel.conf.
Add a monitoring configuration for a Redis master named mymaster with IP 127.0.0.1 and port 6379.
Set the quorum to 2 in the Sentinel configuration.
Start Redis Sentinel with the configuration file and verify it is monitoring the master.
💡 Why This Matters
🌍 Real World
Redis Sentinel is used in production to keep Redis databases highly available by monitoring and automatically handling failures.
💼 Career
Understanding Sentinel setup is important for DevOps roles managing Redis clusters to ensure service reliability and uptime.
Progress0 / 4 steps
1
Create the initial Sentinel configuration file
Create a file named sentinel.conf and add the line port 26379 to set the Sentinel port.
Redis
Need a hint?

The Sentinel listens on port 26379 by default. You need to specify this in the configuration file.

2
Add monitoring configuration for the Redis master
In sentinel.conf, add the line sentinel monitor mymaster 127.0.0.1 6379 2 to monitor the master named mymaster at IP 127.0.0.1 and port 6379 with quorum 2.
Redis
Need a hint?

The sentinel monitor command tells Sentinel which master to watch and the quorum needed to agree on failover.

3
Start Redis Sentinel with the configuration
Run the command redis-sentinel sentinel.conf in your terminal to start Redis Sentinel with the configuration file.
Redis
Need a hint?

Use the redis-sentinel command followed by the config file name to start Sentinel.

4
Check Sentinel is monitoring the master
Run redis-cli -p 26379 SENTINEL masters to display the monitored masters and confirm mymaster is listed.
Redis
Need a hint?

The output should include a line with name:mymaster showing the master is monitored.