memcached - How to use Elasticache with Django's MemcachedCache Backend -
what's correct way use amazon's elasticache service (with memcached engine) django's memcachedcache backend?
i have local memcached service running locally, works fine django setting:
caches = { 'default': { 'backend': 'django.core.cache.backends.memcached.memcachedcache', 'location': '127.0.0.1:11211', } } i thought using elasticache simple creating memcached cluster instance , changing setting to:
caches = { 'default': { 'backend': 'django.core.cache.backends.memcached.memcachedcache', 'location': 'instance-name.abcdef.cfg.use1.cache.amazonaws.com:11211', } } however, when test locally, cache silently fails , doesn't store anything.
what doing wrong? how memcachedcache backend show real error message? need use elasticache-specific django backend this?
you're unable connect elasticache instances outside of aws's network. though security groups might have exceptions in allow traffic ip address (or entire internet), aws's network not accept traffic not originate within network.
this configuration fine, work ec2 instance.
alternatively can follow this guide (which confirms answer above) involves spinning ec2 instance who's ip address use in caches configuration instead. instance configured nat between incoming traffic on port 11211 , forward onto elasticache node. configuration far ideal, , shouldn't ever used in production though.
Comments
Post a Comment