How to use Elasticache with Django MemcachedCache Backend

What is the correct way to use the Amazon Elasticache service (with the Memcached engine) with the Django MemcachedCache backend?

I have a local Memcached service running locally that works fine with Django setup:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

I thought using Elasticache would be as simple as instantiating a Memcached cluster, and then changing my setting to:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': 'instance-name.abcdef.cfg.use1.cache.amazonaws.com:11211',
    }
}

However, when I test this locally, the cache silently fails and saves nothing.

What am I doing wrong? How to make MemcachedCache server show real error message? Do I need to use the Elasticache-specific Django backend, like this one ?

+4
1

ElastiCache AWS. , , IP- ( ), AWS , .

, EC2.

( ), , EC2, IP- CACHES. NAT 11211 ElastiCache node. .

+2

All Articles