X Tutup
Skip to content

Commit 1ee91fe

Browse files
authored
Add doc and debugging tool for Redis (letsencrypt#5885)
1 parent 06ba17c commit 1ee91fe

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

docs/redis.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Redis
2+
3+
We use Redis Cluster for OCSP. The Boulder dev environment stands up a cluster
4+
of 6 nodes, with 3 primaries and 3 replicas. Check docker-compose.yml for
5+
details of those.
6+
7+
The initial setup is done by test/redis-create.sh, which assigns all the
8+
individual Redis nodes to their roles as primaries or replicas.
9+
10+
## Debugging
11+
12+
Our main tool for interacting with our OCSP storage in Redis is cmd/rocsp-tool.
13+
However, sometimes if things aren't working right you might want to drop down a
14+
level.
15+
16+
The first tool you might turn to is `redis-cli`. You probably don't
17+
have redis-cli on your host, so we'll run it in a Docker container. We
18+
also need to pass some specific arguments for TLS and authentication. There's a
19+
script that handles all that for you: `test/redis-cli.sh`. First, make sure your
20+
redis cluster is running:
21+
22+
```
23+
docker-compose up bredis_clusterer
24+
```
25+
26+
Then, in a different window, run:
27+
28+
```
29+
./test/redis-cli.sh -h 10.33.33.2
30+
```
31+
32+
You can pass any IP address for the -h (host) parameter. The full list of IP
33+
addresses for Redis nodes is in `docker-compose.yml`. You can also pass other
34+
redis-cli commandline parameters. They'll get passed through.
35+
36+
You may want to go a level deeper and communicate with a Redis node using the
37+
Redis protocol. Here's the command to do that (run from the Boulder root):
38+
39+
```
40+
openssl s_client -connect 10.33.33.2:4218 \
41+
-CAfile test/redis-tls/minica.pem \
42+
-cert test/redis-tls/boulder/cert.pem \
43+
-key test/redis-tls/boulder/key.pem
44+
```
45+
46+
Then, first thing when you connect, run `AUTH <user> <password>`. You can get a
47+
list of usernames and passwords from test/redis.config.

test/redis-cli.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -feuo pipefail
4+
5+
ARGS="--tls \
6+
-p 4218 \
7+
--cert /test/redis-tls/redis/cert.pem \
8+
--key /test/redis-tls/redis/key.pem \
9+
--cacert /test/redis-tls/minica.pem \
10+
--user replication-user \
11+
--pass 435e9c4225f08813ef3af7c725f0d30d263b9cd3"
12+
13+
exec docker-compose exec bredis_clusterer redis-cli "${ARGS}" "${@}"

0 commit comments

Comments
 (0)
X Tutup