Introducing Dragonfly Cloud! Learn More

Question: How can you configure and use Redis Enterprise with Sentinel?

Answer

Redis Sentinels are part of the high availability solution provided by Redis. They can monitor master and replica instances, notifying applications about the switch in roles due to system level failures. In enterprise environments, high availability and failover handling are critical, and that's where Sentinel comes into play.

Although Redis Enterprise provides built-in automatic failover, you might still need to use Sentinel when it's necessary to notify clients about failovers or when dealing with other systems like stunnel, PgBouncer, etc. Redis Enterprise uses its own cluster management and doesn't directly integrate with Sentinel. Any instance managed by Redis Enterprise would be independent of Sentinel.

Here's a basic setup for Redis with Sentinel:

# Start the Redis server redis-server /path/to/your/redis.conf # Start the Redis Sentinel redis-sentinel /path/to/your/sentinel.conf

Your sentinel.conf file should at minimum include the master that Sentinel will be monitoring:

sentinel monitor mymaster 127.0.0.1 6379 2 sentinel down-after-milliseconds mymaster 5000 sentinel failover-timeout mymaster 10000

In the above configuration:

  • "mymaster" is the name given to the master Redis instance.
  • "127.0.0.1" is the IP address of the Redis master.
  • "6379" is the port number on which the master is running.
  • The number "2" is the quorum, i.e., the number of sentinels that need to agree about the fact that the master is not reachable.
  • down-after-milliseconds configures the time (in milliseconds) the Sentinel waits before deciding the master is down.
  • failover-timeout configures the time (in milliseconds) the Sentinel waits before starting a new failover attempt if the last one was unsuccessful.

For more detailed configuration options and setup instructions, see Redis Sentinel Documentation.

Please consult the Redis Enterprise documentation or contact Redis Labs for specific instructions on integrating with Redis Enterprise.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Start building today 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.