CLI: Redis Cluster Management

Manage Redis clusters with the agentmetal redis subcommand.

CLI: Redis Cluster Management

Overview

The agentmetal redis subcommand manages Redis clusters for caching, session storage, and pub/sub messaging. Three deployment modes are supported: standalone, sentinel (high availability), and cluster (horizontal scaling).

Operations

Create a Redis Cluster

agentmetal redis create \
  --name cache-primary \
  --mode sentinel \
  --nodes 3 \
  --version 7.2
FlagRequiredDescription
--nameYesCluster name
--modeYesDeployment mode: standalone, sentinel, or cluster
--nodesNoNumber of nodes (default: 1 for standalone, 3 for sentinel/cluster)
--versionNoRedis version (default: 7.2)
--evictionNoEviction policy (default: allkeys-lru)
--persistenceNoEnable AOF persistence (default: true)
### List Redis Clusters
agentmetal redis list
ID            NAME            MODE       NODES   VERSION   STATE
redis-a1b2    cache-primary   sentinel   3       7.2       running
redis-c3d4    session-store   standalone 1       7.2       running

Get / Delete

agentmetal redis get redis-a1b2
agentmetal redis delete redis-a1b2

Deployment Modes

ModeDescriptionMin Nodes
standaloneSingle Redis instance, no replication1
sentinelMaster-replica with automatic failover via Sentinel3
clusterSharded cluster with hash slots for horizontal scaling3
## Examples

Create a Redis cluster for production caching:

agentmetal redis create \
  --name prod-cache \
  --mode cluster \
  --nodes 6 \
  --version 7.2 \
  --eviction allkeys-lfu \
  --persistence

Create a simple standalone instance for development:

agentmetal redis create --name dev-redis --mode standalone