|
| 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. |
0 commit comments