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
demandé il y a 2 ans331 vues
3 réponses
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
répondu il y a 2 ans
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
répondu il y a 2 ans
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

répondu il y a 2 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions