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
| Flag | Required | Description |
|---|---|---|
--name | Yes | Cluster name |
--mode | Yes | Deployment mode: standalone, sentinel, or cluster |
--nodes | No | Number of nodes (default: 1 for standalone, 3 for sentinel/cluster) |
--version | No | Redis version (default: 7.2) |
--eviction | No | Eviction policy (default: allkeys-lru) |
--persistence | No | Enable AOF persistence (default: true) |
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
| Mode | Description | Min Nodes |
|---|---|---|
standalone | Single Redis instance, no replication | 1 |
sentinel | Master-replica with automatic failover via Sentinel | 3 |
cluster | Sharded cluster with hash slots for horizontal scaling | 3 |
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