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¶
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 keysvolatile-lru: Evict LRU keys with expire setallkeys-random: Evict random keysvolatile-ttl: Evict keys with shortest TTLnoeviction: 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¶
- Open
http://localhost:8081 - Add database:
localhost:6379 - Enter password
- 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¶
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¶
Troubleshooting¶
Memory Issues¶
Check memory usage:
Increase limit if needed:
Connection Refused¶
- Check service is running
- Verify port binding:
podman port redis-svc - 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.