Administer Redis
Redis serves as the message queue backing store for Itential Platform and stores authentication tokens. This guide covers the routine maintenance tasks required to keep a Redis Sentinel cluster healthy, performant, and secure.
For configuration properties and how Platform connects to standalone or HA Redis topologies, see Configure Redis and monitor health. For detailed metrics, PromQL expressions, and alert thresholds, see Redis metrics reference and Redis Sentinel metrics reference.
Before you begin
The commands in this guide assume the following environment variables are set:
Retrieve REDIS_ADMIN_PASS and REDIS_SENTINEL_ADMIN_PASS from your secrets manager at the start of each maintenance session and hold them only in shell variables for the session’s duration.
The examples below use HashiCorp Vault syntax. Adjust the retrieval commands to match your secrets manager’s API:
Passwords must never be stored in scripts, configuration files, or shell history. Retrieve credentials from your secrets manager at runtime and let them leave scope when the session ends.
The current primary is managed by Sentinel and can change at any time after a failover. Always resolve it at runtime rather than hardcoding a hostname:
TLS configuration varies by deployment. When TLS is enabled, append --tls --cacert <ca-cert-path> to every redis-cli command in this guide.
Check health and replication status
Redis is a single-threaded, in-memory store. In a Sentinel-managed deployment, one node holds the primary role and accepts all writes while the others replicate asynchronously. If the primary becomes unreachable, Sentinel promotes a replica, but only if quorum is healthy and replication lag is acceptable at the time. Regular health checks confirm that all nodes are reachable, replication is current, and Platform has a functioning data store.
PING all nodes
All nodes should respond PONG. Investigate any node that doesn’t respond immediately; it may have crashed, lost network connectivity, or exhausted its client connection limit before Sentinel has triggered a failover.
Check replication status
Flag any replica with master_link_status:down or a large offset delta; a lagging replica can’t safely become primary in a failover.
Identify the current primary
The response is two lines: the hostname on the first line and the port on the second.
Resolve the primary before any write operation or maintenance task rather than relying on a cached value.
Manage the Sentinel cluster
Redis Sentinel monitors Redis nodes, detects failures, and coordinates failovers. A majority of Sentinel processes (quorum) must agree the primary is unreachable before a failover triggers. If too few Sentinel instances are running, or they disagree on the primary, automatic failover doesn’t work.
Check quorum
Expect OK N usable Sentinels. Quorum and failover authorization can be reached on every node. In a three-node Sentinel cluster, quorum is two; if only one Sentinel is reachable, the cluster is effectively unprotected.
List Sentinel members
Confirm the number of entries matches the expected Sentinel count and each shows flags: sentinel with no disconnected flag. Sentinel’s view of membership can drift after a node replacement or network partition.
Interpret the failover event timeline
When reviewing Sentinel logs after an unexpected failover, events appear in a predictable order:
A +sdown never followed by +odown means quorum wasn’t reached and no failover occurred, indicating a split-brain or Sentinel availability problem.
Manage Redis and Sentinel services
Redis and Redis Sentinel run as separate systemd services managed independently. Restarting the primary triggers a Sentinel failover; stopping a majority of Sentinel instances prevents any future failover. Always restart replicas before the primary.
Check status on all nodes
Start, stop, or restart Redis on a single node
Restarting a replica is low-risk. Restarting the primary triggers a Sentinel failover, which briefly interrupts writes for Platform. If you need to restart the primary, trigger a controlled failover first (SENTINEL failover $SENTINEL_MASTER) so the node you restart is already a replica.
After a start or restart, verify the node responds and replication re-establishes:
Start, stop, or restart Sentinel on a single node
Stopping Sentinel on one node reduces quorum. Stopping it on a majority of nodes disables automatic failover entirely until Sentinel is restored.
After a start or restart, verify quorum is restored:
Review configuration files
The Redis configuration file is at /etc/redis/redis.conf on each node; the Sentinel configuration file is at /etc/redis/sentinel.conf. Sentinel also writes back to its file at runtime when a failover occurs, updating the known primary address, so review it after a failover to confirm it reflects current topology.
Enable services to start on boot
A node that reboots without this enabled stays offline until someone manually starts it, silently reducing quorum.
Manage memory and eviction
Redis stores all data in memory. When usage approaches the configured limit, Redis evicts keys according to its eviction policy. If eviction can’t keep up with writes, new commands are rejected, which can stall queue workers or make job status unavailable.
Check memory usage and eviction policy
Check eviction and connection rejection stats
evicted_keys above 0 means Redis is discarding message queue data to stay within maxmemory; review key TTLs and the eviction policy. rejected_connections above 0 means maxclients was hit, a critical condition that causes client errors and can trigger a Sentinel failover if the primary can no longer serve health checks.
Check client connection counts
Flag any node where connected_clients is within 20% of maxclients. blocked_clients above 0 indicates clients waiting on BLPOP, BRPOP, or WAIT; a small number is normal for queue workers, but a growing count indicates stalled consumers.
Manage keys
Check key count and average TTL
A database with many keys and an average TTL of zero contains keys that never expire on their own, the first candidates for cleanup if memory pressure is growing.
Scan and inspect keys
Never use KEYS in production; it blocks Redis while it iterates the entire keyspace. Use SCAN instead.
A TTL of -1 means the key has no expiry and persists indefinitely; -2 means the key doesn’t exist.
Check persistence health
Redis can persist to disk using RDB snapshots, an append-only file (AOF), or both. A silent persistence failure means Redis appears healthy but isn’t writing to disk; if the process restarts, queued jobs representing in-flight Platform work are lost.
Check RDB snapshot status
Expect rdb_last_bgsave_status: ok and loading: 0. A failed snapshot doesn’t stop Redis from serving requests, so check this routinely rather than waiting for a restart to reveal a stale on-disk copy.
Check AOF status
An AOF write failure is more serious than an RDB failure; it can indicate Redis is falling behind on durability, not just snapshotting. If both report errors simultaneously, check the Redis log for a MISCONF error, which indicates a configuration conflict between the two mechanisms.
Manage users and credentials
Redis uses an access control list (ACL) to manage permissions. This deployment uses the following ACL users:
List ACL users
Flag any expected user that’s missing or shows off; a disabled ACL user causes the dependent service to fail authentication in a way that may not be obvious from application logs.
Rotate a user password
High-risk. Because Platform reads its Redis password from your secrets manager at startup, rotating a credential requires coordinating a secrets manager update with a Platform restart. Update your secrets manager first, then update Redis. Updating Redis first creates a window where the two are out of sync.
Update the secret in your secrets manager
Generate a new password and store it before making any change to Redis.
Inspect logs
Redis and Sentinel write separate log files. The Redis log records server-level events: memory pressure, persistence failures, replication changes, and client connection errors. The Sentinel log records the complete history of every failover, quorum decision, and topology change.
Confirm these paths against your deployment; they can be customized.
Search for key patterns
Search for a specific pattern
View recent log entries on a single node
Rotate TLS certificates
TLS certificates have a fixed expiry date. When a node’s certificate expires, clients and Sentinel processes can no longer verify its identity and refuse to connect, breaking replication and preventing new Platform connections. Unlike services that degrade gradually, an expired Redis certificate causes an immediate hard failure.
Redis and Sentinel maintain separate TLS configurations; both must be updated when certificates change. If the CA certificate changes, update every redis-cli command in this guide to reference the new CA file path.
TLS certificate files are referenced in /etc/redis/redis.conf on each node:
Verify the new certificate locally before deploying
Run these checks on the machine where the new certificate was generated:
Don’t proceed if openssl verify returns an error or the modulus hashes don’t match.
Copy new certificate files to each node
Adjust ownership if your Redis process doesn’t run as redis:redis. Back up the previous files first (for example redis.crt.bak) so a rollback is a one-command restore.
Roll out the change: replicas first, primary last
For each replica:
Don’t restart the next node until this one responds PONG. For the primary, trigger a controlled failover first, then restart what is now a replica:
Rollback
If a new certificate causes connection failures, restore the backed-up files and restart both services:
Verify connectivity after rollback: