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년 전318회 조회
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

답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠