Redis high availability and Redis Cluster
You set up replication and Sentinel failover in depth, configure and reshard Redis Cluster, and manage persistence and backups across the cluster.
Level 401 · 17 lessons · 15 practice labs
Lessons
Replication and Sentinel
- How replication works: full and partial sync
- Replica settings and read-only replicas
- Monitoring with three Sentinels
- Failover and client discovery
- Write assurance with WAIT
- Short task: kill the primary and measure the data loss
Redis Cluster
- Hash slots and cluster structure
- Creating a cluster
- Hash tags and multi-key commands
- Cluster clients and redirects
- Resharding and adding nodes
- Failover in the cluster
- Short task: add a node without downtime
Operations
- Backup and restore in a cluster
- Capacity and memory planning
- Upgrading without downtime
- Capstone: the Redis cluster of a gaming platform
Practice labs
- Add a replica and watch it sync: Attach a replica and see with INFO replication that the full sync finishes and lag drops to zero.
- Get partial resync after a short drop: Size the backlog so a disconnected replica does a partial rather than full resync, and test it.
- Kill the primary and measure loss with WAIT: Write with and without WAIT, kill the primary and compare how many records are lost in each case.
- Read the view of three Sentinels: Use Sentinel commands to list the monitored primary, replicas and quorum.
- Trigger a failover with Sentinel: Stop the primary, time the failover and confirm the client finds the new primary through Sentinel.
- Reduce split-brain risk: Reproduce an isolated old primary still taking writes and limit it with min-replicas settings.
- Find which node holds a key: Compute key slots with CLUSTER KEYSLOT and show which node holds each key.
- Create a six-node cluster: Build a cluster of three primaries and three replicas and verify slot spread and replica pairing.
- Make a multi-key command work with hash tags: Rename keys with hash tags so a cart operation that fails with CROSSSLOT lands in a single slot.
- Watch client redirects: See MOVED replies with redis-cli in and out of cluster mode and explain the difference.
- Add a node without downtime: Add a new primary to a cluster under load, move slots and watch clients run without errors.
- Handle a node loss in the cluster: Work out the cluster state when a primary and its replica fail together and recover slot coverage.
- Back up every node of the cluster: Write a short script that takes an RDB backup from every primary into a dated folder.
- Plan memory capacity: Calculate memory needs six months out from key count and growth rate and propose a node count.
- Upgrade the cluster in a rolling way: Upgrade replicas first, fail over by hand and move the whole cluster to a new version without the game server losing its connection.
About this course
You set up replication and Sentinel failover in depth, configure and reshard Redis Cluster, and manage persistence and backups across the cluster.
What you will learn
- Replication and Sentinel
- Redis Cluster
- Operations
Prerequisites
You should have practised the topics of the same path up to level 301.
Lab environment
Lessons run in your own Kali Linux terminal in the browser, connected to a private lab network. Nothing to install.
Frequently asked questions
- Is this course right for my level?
- The course is at level 401; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.