Redis Cheatsheet - rivernews/iriversland2-kubernetes GitHub Wiki
- Use redis CLI:
redis-cli -h host-name-or-ip -p port-num
- If you don't have redis-cli, like in nginx container, you can instead use
$ (printf "PING\r\n";) | nc localhost 6379
(SO)
Spin up redis cli redis-cli
.
- Check overall usage across each db number:
INFO keyspace
- Select db:
SELECT <db num>
- List keys
KEYS <regex>
- Show value
MGET "<key>" "<key2>" ...
, e.g.mget "bull:cronjobs:completed"
. - Clean all keys in current db
FLUSHDB
, or clean all dbFLUSHALL
- PubSub - list all current available channel:
PUBSUB CHANNELS
. - List all client
CLIENT LIST
. Kill client:CLIENT KILL ADDR host:port
, orCLIENT KILL ID idOfClient
.