Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn High Availability with Redis Sentinel | Scaling Redis
Quizzes & Challenges
Quizzes
Challenges
/
Redis Intermediate Concepts

bookHigh Availability with Redis Sentinel

Redis Sentinel is a system designed to manage Redis instances in a highly available setup. It monitors your Redis servers, detects failures, and automatically promotes a replica to master if the original master becomes unavailable.

Practical Example: Using Redis Sentinel for High Availability

Imagine you manage an online store that relies on a Redis database to cache product information. To ensure your Redis service is always available, you deploy three Redis Sentinel instances to monitor your primary Redis server (called the master) and two replica servers (slaves).

Setting Up Sentinel Monitoring

You want Sentinel to monitor your master server, which is running on IP 192.168.1.10 and port 6379. To do this, you use the SENTINEL MONITOR command. Connect to a Sentinel instance and run:

SENTINEL MONITOR mymaster 192.168.1.10 6379 2
  • SENTINEL MONITOR tells Sentinel to start monitoring a master named mymaster at the specified IP and port.
  • The last number (2) is the quorum: the minimum number of Sentinels that must agree the master is down before a failover occurs.

Simulating a Failover

Suppose the master server becomes unavailable due to a hardware failure. Sentinel detects the outage and can automatically promote one of the replicas to be the new master. You can also trigger this process manually using the SENTINEL FAILOVER command:

SENTINEL FAILOVER mymaster
  • SENTINEL FAILOVER instructs Sentinel to begin a failover process for the monitored master named mymaster.
  • Sentinel will select one of the replicas, promote it to master, and update all other nodes to recognize the new master.

This setup ensures your online store remains operational, even if the original master server fails. Redis Sentinel continuously monitors your infrastructure and uses these commands to maintain high availability automatically or at your request.

question mark

What is a key function of Redis Sentinel in supporting high availability for Redis deployments?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 2

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Awesome!

Completion rate improved to 9.09

bookHigh Availability with Redis Sentinel

Swipe to show menu

Redis Sentinel is a system designed to manage Redis instances in a highly available setup. It monitors your Redis servers, detects failures, and automatically promotes a replica to master if the original master becomes unavailable.

Practical Example: Using Redis Sentinel for High Availability

Imagine you manage an online store that relies on a Redis database to cache product information. To ensure your Redis service is always available, you deploy three Redis Sentinel instances to monitor your primary Redis server (called the master) and two replica servers (slaves).

Setting Up Sentinel Monitoring

You want Sentinel to monitor your master server, which is running on IP 192.168.1.10 and port 6379. To do this, you use the SENTINEL MONITOR command. Connect to a Sentinel instance and run:

SENTINEL MONITOR mymaster 192.168.1.10 6379 2
  • SENTINEL MONITOR tells Sentinel to start monitoring a master named mymaster at the specified IP and port.
  • The last number (2) is the quorum: the minimum number of Sentinels that must agree the master is down before a failover occurs.

Simulating a Failover

Suppose the master server becomes unavailable due to a hardware failure. Sentinel detects the outage and can automatically promote one of the replicas to be the new master. You can also trigger this process manually using the SENTINEL FAILOVER command:

SENTINEL FAILOVER mymaster
  • SENTINEL FAILOVER instructs Sentinel to begin a failover process for the monitored master named mymaster.
  • Sentinel will select one of the replicas, promote it to master, and update all other nodes to recognize the new master.

This setup ensures your online store remains operational, even if the original master server fails. Redis Sentinel continuously monitors your infrastructure and uses these commands to maintain high availability automatically or at your request.

question mark

What is a key function of Redis Sentinel in supporting high availability for Redis deployments?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 2
some-alt