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

ModeNodesDescription
Standalone1Single Redis instance for development or caching
Sentinel3+High availability with Redis Sentinel for automatic failover
Cluster6+Sharded Redis Cluster for horizontal scaling
## Features
  • 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:

  1. Redis installation — installs Redis on provisioned VMs and applies OS-level tuning (vm.overcommit_memory, transparent huge pages)
  2. Sentinel configuration — deploys Redis Sentinel processes, configures quorum, and sets up monitoring of the primary
  3. Cluster formation — initializes Redis Cluster, assigns hash slots, and adds replica nodes
  4. Failover — detects primary failure via sentinel, coordinates promotion, and updates connection information
  5. Persistence management — configures AOF/RDB schedules based on your requirements and available disk
  6. 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.