Skip to content

Redis Role

In-memory data store with RedisInsight GUI for caching, queues, and key-value storage testing.

Features

  • Rootless Podman deployment
  • Password authentication
  • RedisInsight web interface included
  • Configurable memory limits and eviction policies
  • Persistence options (RDB, AOF)

Quick Start

./manage-svc.sh redis prepare
./manage-svc.sh redis deploy
./svc-exec.sh redis verify

Configuration

Key Variables

redis_state: present
redis_data_dir: "~/redis-data"
redis_port: 6379
redis_gui_port: 8081
redis_password: "your_secure_password"
redis_maxmemory: "256mb"
redis_maxmemory_policy: "allkeys-lru"

Memory Policies

  • allkeys-lru: Evict least recently used keys
  • volatile-lru: Evict LRU keys with expire set
  • allkeys-random: Evict random keys
  • volatile-ttl: Evict keys with shortest TTL
  • noeviction: Return errors when memory limit reached

Usage

Access

  • Redis server: localhost:6379
  • RedisInsight GUI: http://localhost:8081

CLI Examples

# Connect to Redis
podman exec -it redis-svc redis-cli -a your_password

# Set a key
redis-cli -a your_password SET mykey "Hello"

# Get a key
redis-cli -a your_password GET mykey

# Check info
redis-cli -a your_password INFO memory

RedisInsight

  1. Open http://localhost:8081
  2. Add database: localhost:6379
  3. Enter password
  4. Browse keys, monitor performance

Service Management

# Status
systemctl --user status redis-pod

# Logs
podman logs redis-svc
podman logs redisinsight

# Restart
systemctl --user restart redis-pod

Use Cases

  • Cache testing
  • Session store testing
  • Queue implementation (lists, streams)
  • Pub/Sub messaging tests
  • Rate limiting tests
  • Leaderboard/counter testing

Performance Testing

# Benchmark
podman exec redis-svc redis-benchmark -a your_password -n 10000

Backup

RDB Snapshot

# Trigger save
redis-cli -a your_password BGSAVE

# Copy RDB file
cp ~/redis-data/dump.rdb ~/backups/redis-$(date +%Y%m%d).rdb

AOF Backup

cp ~/redis-data/appendonly.aof ~/backups/

Troubleshooting

Memory Issues

Check memory usage:

redis-cli -a your_password INFO memory

Increase limit if needed:

redis_maxmemory: "512mb"

Connection Refused

  1. Check service is running
  2. Verify port binding: podman port redis-svc
  3. Check firewall rules

Removal

# Keep data
./manage-svc.sh redis remove

# Delete all
./manage-svc.sh redis remove -e redis_delete_data=true

License

MIT

Author

Created by jackaltx and Claude.