0
votes

Hi I am trying to connect my Django application to use Redis ElastiCache and am having trouble with getting it connected using AWS. The application is published to an EC2 instance using Elastic Beanstalk and it running perfect when I am not trying to connect to my Redis cache.

From the post here (Setting up ElastiCache Redis with Elastic BeanStalk + Django) I created my ElastiCache to not use a cluster and I have set up both the EC2 instance and the Redis cache to use the same Security Group.

Here is how my cache is configured in settings.py.

CACHES = {
'default': {
    'BACKEND': 'django_redis.cache.RedisCache',
    'LOCATION': 'redis://my-cache.kjshd.0001.use2.cache.amazonaws.com:6379/',
    'OPTIONS': {
        'CLIENT_CLASS': 'django_redis.client.DefaultClient'
    }
  }
}

What am I missing? Are there additional settings that need changed on my cache or somewhere in AWS to open communication? Does this configuration look okay? I was previously using Redis in Azure and this configuration worked but now have the requirement to move to AWS. Is there a way to test that my EC2 instance can connect to Redis? I have the ability to SSH into the server but I was not sure what I would do once I was connected.

Thanks for any help.

1

1 Answers

1
votes

After setting the security group, I found out that I needed to change the inbound settings for the security group to connect to my ElastiCache Redis node.

Documentation was found here.

https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/GettingStarted.AuthorizeAccess.html#GettingStarted.AuthorizeAccess.VPC