使用 ElastiCache Redis 配置 django-redis 时出现问题(已启用集群模式)

Problem configuring django-redis with ElastiCache Redis (cluster mode enabled)

我正在开发 Django 项目,该项目当前使用 ElastiCache Redis 3.2.6,在 "master/slave" 配置中使用 "redis_cache.RedisCache" 后端的多个节点。这目前工作正常。

但是,我正在将项目迁移到启用了集群模式的新 ElastiCache Redis 5.0.3 实例。我未能找到任何记录的配置从 Django 到 Redis 集群的 ElastiCache 配置端点的连接的方法。我发现的最接近的东西是 this comment on the django-redis GitHub 但是当我尝试该配置时我收到一条错误消息:

rediscluster.exceptions.RedisClusterException: Redis Cluster cannot be connected. Please provide at least one reachable node.

有没有更好的方法来完成我所缺少的?

我明白了。这是一个有效的配置:

"default": {
    'BACKEND': 'django_redis.cache.RedisCache',
    'LOCATION':"redis://mycluster.foo.clustercfg.use1.cache.amazonaws.com/0",
    'OPTIONS': {
        'REDIS_CLIENT_CLASS': 'rediscluster.StrictRedisCluster',
        'CONNECTION_POOL_CLASS': 'rediscluster.connection.ClusterConnectionPool',
        'CONNECTION_POOL_KWARGS': {
            'skip_full_coverage_check': True  # AWS ElasticCache has disabled CONFIG commands
         }
    }
}