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
已提問 2 年前檢視次數 295 次
3 個答案
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 pictureAWS
已回答 2 年前
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

AWS
已回答 2 年前
0

Same issue with mine , if you solve the issue, can you Let me Know how you can do that.

I'm able to connect with that but when i send the ping to the redis i got this response from that.

Error: Server closed the connection (5.01s)

You can check this in img also, try to help me how can i resolve that.image

已回答 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南