William Liu

Redis

Redis

All commands can be found here: https://redis.io/commands

Start the CLI with redis-cli and you should see a prompt like:

127.0.0.1:6379>

Exit with exit

Common Commands

KEYS

keys * to show all keys

> keys *
1.) "processes"
2.) "queues"

MGET

> MGET queues
1) (nil)

TYPE key

Keys can be different types, from string, list, set, zset, hash, and stream

type my_key to see the type of the value stored at a key

> type "queues"
set

SMEMBERS key

Returns all the members of the set value stored at key

> SMEMBERS "queues"
1.) "default"

Redis Logs

Find your redis config (e.g. on my local, it is under /usr/local/etc/redis.conf Here you can set the logfile (e.g. redis-log and the verbosity. You can find the log file in your config with redis-cli CONFIG GET '*'

Run Redis with Config

To run redis with a specific config, you can run something like:

`redis-server /usr/local/etc/redis.conf`