2020-04-21 23:34:34 +02:00
Redis is used as a key-value store for rspamd's and (some of) mailcow's settings and data. If you are unfamiliar with redis please read the [introduction to redis ](https://redis.io/topics/introduction ) and maybe visit this [wonderful guide ](http://try.redis.io/ ) on how to use it.
2017-05-06 15:32:16 +02:00
2017-05-06 16:50:21 +02:00
## Client
2017-05-06 15:32:16 +02:00
To connect to the redis cli execute:
2017-05-06 00:22:26 +02:00
```
docker-compose exec redis-mailcow redis-cli
```
2017-05-06 15:46:57 +02:00
### Debugging
2020-04-21 23:34:34 +02:00
Here are some useful commands for the redis-cli for debugging:
2017-05-06 15:40:42 +02:00
2017-05-06 15:46:57 +02:00
##### MONITOR
2017-05-06 15:43:28 +02:00
Listens for all requests received by the server in real time:
2017-05-06 15:40:42 +02:00
```
# docker-compose exec redis-mailcow redis-cli
127.0.0.1:6379> monitor
OK
1494077286.401963 [0 172.22.1.253:41228] "SMEMBERS" "BAYES_SPAM_keys"
1494077288.292970 [0 172.22.1.253:41229] "SMEMBERS" "BAYES_SPAM_keys"
[...]
```
2017-05-06 15:46:57 +02:00
##### KEYS
2017-05-06 15:43:28 +02:00
Get all keys matching your pattern:
2017-05-06 15:40:42 +02:00
```
2017-05-06 23:00:41 +02:00
KEYS *
2017-05-06 15:40:42 +02:00
```
2017-05-06 15:46:57 +02:00
##### PING
2017-05-06 15:43:28 +02:00
Test a connection:
2017-05-06 15:40:42 +02:00
```
127.0.0.1:6379> PING
PONG
```
If you want to know more, here is a [cheat sheet ](https://www.cheatography.com/tasjaevan/cheat-sheets/redis/ ).