Currently I am trying to integrate redis into my django project which is docker based. I was able to integrate redis using the DefaultClient but it doesn't work for SentinelClient
My settings.py looks like this:
DJANGO_REDIS_CONNECTION_FACTORY = 'django_redis.pool.SentinelConnectionFactory'
SENTINELS = [
('redis://redis-sentinel', 26379),
]
# redis-sentinel is the name of redis sentinel container
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://redis-queue-1:6379',
'OPTIONS': {
'SENTINELS': SENTINELS,
# django_redis.client.SentinelClient
'CLIENT_CLASS': 'django_redis.client.SentinelClient',
'CONNECTION_POOL_CLASS': 'redis.sentinel.SentinelConnectionPool',
},
}
}
It doesn't throw any exception, django just gets stuck on loading
Edit:
Upon trying to open shell and manually setting up a cache key I am presented with this error
redis.sentinel.MasterNotFoundError: No master found for 'redis-queue-1'
Although I used the same service name for default client and it works but presents an error for SentinelClient