Cache
Managed Redis instances with standalone, sentinel (HA), and cluster (sharded) modes — including persistence, replication, and failover.
Cache
The Cache service provides managed Redis instances with support for standalone, sentinel (HA), and cluster (sharded) modes. The Cache Agent handles installation, configuration, replication, and automatic failover.
Modes
| Mode | Nodes | Description |
|---|---|---|
| Standalone | 1 | Single Redis instance for development or caching |
| Sentinel | 3+ | High availability with Redis Sentinel for automatic failover |
| Cluster | 6+ | Sharded Redis Cluster for horizontal scaling |
- Persistence — configurable AOF (Append Only File) and RDB (snapshot) persistence
- Eviction policies — choose from noeviction, allkeys-lru, volatile-lru, allkeys-random, and more
- Replication monitoring — the agent tracks replication lag and replica health
- Auto-failover — in sentinel mode, the agent detects primary failure and coordinates promotion
Create a Redis Instance
Standalone
agentmetal redis create --name dev-cache --mode standalone
Sentinel (High Availability)
agentmetal redis create \
--name cache \
--mode sentinel \
--nodes 3
This creates one primary and two replicas, with three sentinel processes monitoring the group.
Cluster (Sharded)
agentmetal redis create \
--name session-store \
--mode cluster \
--nodes 6
Creates a 6-node Redis Cluster with 3 masters and 3 replicas, distributing hash slots across masters.
Configuration
Set Redis configuration parameters:
agentmetal redis config set cache \
--param maxmemory=2gb \
--param maxmemory-policy=allkeys-lru \
--param appendonly=yes
Get Connection Info
agentmetal redis get cache --connection-string
For sentinel mode, the output includes the sentinel addresses and master name for client configuration.
What the Agent Manages
The Cache Agent performs these operations:
- Redis installation — installs Redis on provisioned VMs and applies OS-level tuning (vm.overcommit_memory, transparent huge pages)
- Sentinel configuration — deploys Redis Sentinel processes, configures quorum, and sets up monitoring of the primary
- Cluster formation — initializes Redis Cluster, assigns hash slots, and adds replica nodes
- Failover — detects primary failure via sentinel, coordinates promotion, and updates connection information
- Persistence management — configures AOF/RDB schedules based on your requirements and available disk
- Health monitoring — checks memory usage, connected clients, replication lag, and keyspace hit rate
Scaling
Scale a cluster by adding more shards:
agentmetal redis scale session-store --nodes 9
The agent adds new nodes, rebalances hash slots, and ensures data migration completes before marking the operation as done.