|
| 1 | +--- |
| 2 | +title: Redict |
| 3 | +--- |
| 4 | + |
| 5 | +## Seamless migration between providers |
| 6 | + |
| 7 | +We have tested a seamless migration from Redis to Redict on our production |
| 8 | +deployment. To reproduce: |
| 9 | + |
| 10 | +1. We have deployed Redict to our production cluster. |
| 11 | + |
| 12 | + - Defaults have been changed to: |
| 13 | + |
| 14 | + ```yaml |
| 15 | + with_redis: false |
| 16 | + with_redict: true |
| 17 | + ``` |
| 18 | +
|
| 19 | + These can be changed in their respective `vars/` files. |
| 20 | + |
| 21 | + - Run |
| 22 | + |
| 23 | + ``` |
| 24 | + DEPLOYMENT=prod TAGS=redict make deploy |
| 25 | + ``` |
| 26 | + |
| 27 | +2. Using remote shell and `redict-cli` run: |
| 28 | + |
| 29 | + ```sh |
| 30 | + replicaof redis 6379 |
| 31 | + ``` |
| 32 | + |
| 33 | + This converts the Redict instance into a read-only replica of the Redis. |
| 34 | + |
| 35 | +3. After the data exchange is done, change **all** references in variables to |
| 36 | + redis to point to the new hostname, in this case `redis → redict`. |
| 37 | + |
| 38 | + - Run |
| 39 | + |
| 40 | + ``` |
| 41 | + DEPLOYMENT=prod TAGS=packit-service-beat,fedmsg,packit-worker,packit-service make deploy |
| 42 | + ``` |
| 43 | + |
| 44 | +4. Simultaneously run the deployment with the changed hostnames and via |
| 45 | + `redict-cli` run: |
| 46 | + |
| 47 | + ```sh |
| 48 | + replicaof no one |
| 49 | + ``` |
| 50 | + |
| 51 | + to make the redict deployment the primary one. |
| 52 | + |
| 53 | +5. (optional) For safety reasons and easier rollback, it's possible to convert |
| 54 | + the former Redis deployment into a replica of Redict, just in case it needs |
| 55 | + to be reverted without loss of data. For this you can run in `redis-cli`: |
| 56 | + |
| 57 | + ```sh |
| 58 | + replicaof redict 6379 |
| 59 | + ``` |
| 60 | + |
| 61 | +:::warning References to Redis |
| 62 | + |
| 63 | +Redis is being referenced from: |
| 64 | + |
| 65 | +- `packit-service` (API endpoint) |
| 66 | +- `packit-service-fedmsg` (Fedora Messaging listener) |
| 67 | +- `packit-service-beat` (triggers periodic tasks) |
| 68 | +- `packit-worker` (runs the jobs provided by API, Fedora Messaging and “beat”) |
| 69 | +- `flower` (monitoring of the Celery queues) |
| 70 | + |
| 71 | +::: |
0 commit comments