Unable to connect to redis using django-redis

I have a django project using django-redis 3.8.0 to connect to an aws redis instance. However, when I try to connect, I get ConnectionError: Error 111 connecting to None:6379. Connection refused. ConnectionError: Error 111 connecting to None:6379. Connection refused. . If I ssh into my ec2 and use redis-py from the shell, I can read and write from the cache just fine, so I don't consider this a security policy issue.

+6
source share
2 answers

Ok, got it. I needed a prefix of my location redis:// . This is specific to the django-redis library and how it parses the location url. This explains why when I manually configured the StrictRedis connection using the redis python library, I was able to connect.

+11
source

If you use redis for red-cache, you cannot access it from outside AWS - that’s why you get the error.

From AWS FAQs:

Note that IP range-based access control is currently not for cache clusters. All clients in the cache cluster must be on the EC2 network and authorized through security groups as described above.

http://aws.amazon.com/elasticache/faqs/

+1
source

Source: https://habr.com/ru/post/979288/


All Articles