Unable to connect to Redis cluster from EC2 on same VPC

0

Hello, I am having trouble connecting to the cluster host when I am in my EC2 instance (running Amazon Linux) on the same VPC. I have been looking at the following two resources:

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/elasticache-vpc-accessing.html#elasticache-vpc-accessing-same-vpc

and

https://aws.amazon.com/premiumsupport/knowledge-center/elasticache-redis-cluster-fix-connection/

details:

  • My cluster and nodes are available (finished creating)
  • EC2 and Redis cluster using same subnet group on the same VPC
  • Redis cluster is in cluster disabled mode
  • I have set up my security groups to allow inbound and outbound requests from all traffic
  • my domain resolves when running an nslookup
  • when trying to connect via telnet or curl, the connection just times out.

How can I make it so the connection does not time out?

joe
asked 3 months ago38 views
2 Answers
1

Hello Joe.

If your EC2 is in a different subnet you should check routes and network ACL between Redis and Linux subnets, refer to this article about subnet routing.

Hope this helps.

profile picture
answered 3 months ago
0

Hi Joe,

In case this still isn't working for you please try the following:

  1. Check that your redis cluster has a security group added to it.

Go to ElastiCache -> Redis Clusters then select your cluster. Under "Network & Security" -> Security Groups check that there is a security group defined. If not, add a security group that allows connectivity from your EC2 instance and re-test.

  1. If your redis cluster already has a security group defined, check that it has an inbound rule which lets your EC2 instance connect to it.

Go to ElastiCache -> Redis Clusters then select your cluster. Under "Network & Security" -> Security Groups, select the security group to show the details of the inbound rules. Make sure there is an inbound rule for port 6379 coming from the security group of your EC2 instance (assuming you left the port number at the default)

Hopefully this will let you connect from your EC2 instance to the redis cluster using something like:

telnet <my-redis-endpoint> 6379

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions