Fix/issue 203 distinct redis db numbers #264
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #203 - Use distinct Redis database numbers to prevent conflicts when redis-main and redis-cache point to the same server
Problem
When redis-main and redis-cache are configured to point to the same Redis server (common in staging environments), there was a database number conflict:
/2on redis-cache/1on redis-mainOriginal Issue Timeline: Reported 3 years ago by @jnm
Solution
Changed
REDIS_SESSION_URLfrom database/2to/3to ensure all database numbers are unique across both redis-main and redis-cache.Changes
templates/kobo-env/envfiles/databases.txt.tpl/2to/3REDIS_SESSION_URLnow uses database/3instead of/2Redis Database Allocation
After this fix, the database numbers are:
redis-main:
/0- Enketo (cannot be configured)/1- Celery broker (CELERY_BROKER_URL)redis-cache:
/3- Django sessions (REDIS_SESSION_URL) => CHANGED/5- Django cache (CACHE_URL)/6- Service account backend (SERVICE_ACCOUNT_BACKEND_URL)All numbers are now distinct, preventing any conflicts when both Redis services point to the same server.
Testing
Impact
Migration Notes
When upgrading to this version:
/3Related