2
votes

I have a VPC with 2 public subnets in different availability zones (public subnet-2a and public-subnet-2b). I have two private subnets (private-2a-EB-Instance, private-2b-EB-Instance), and two other private subnets for Elasticache (private-2a-EB-Instance, private-2b-EB-Instance), these two subnets for elasticache are part of a subnet group that I use when creating my Elasticache clusters.

I have create a security group for my ElastiCache(redis) and I have changed its inbound rules so it can accept connection from the security group of my ElasticBeanstalk environment. Didn't solve the problem.

I have followed the instructions on AWS' website, and I can't get it to work. I wonder what I am doing wrong. I am using socket-io-redis and I am wondering if that may be part of the problem.

I have used the .config file offered here , but I get an error when deploying the app. It says there was an error creating it.

I created the cluster from the console and tried to connect it to my EB app using the "Primary Endpoint", but I get the error:

Error: Redis connection to https://myelasticache.xxxxxxxxx.cache.amazonaws.com:6379 failed - getaddrinfo ENOTFOUND https://myelasticache.xxxxxxxxx.cache.amazonaws.com 

What am I doing wrong? What am I missing?

1
When you login to the EB instance, and manually from there try accessing the EC, it also times out, or its only from your application?Marcin
I have not tried to connect manually to my EC2 instances. Is that what I should do?Rookie
That's what I would do. Have to establish if the connectivity issue is widespread (i.e. any instance in your vpc can't connect to it), or is it local (only your app).Marcin

1 Answers

3
votes

I think the problem is that you have included https:// in what is supposed to be the hostname. Redis does not connect over HTTP, it uses its own protocol. The error message getaddrinfo ENOTFOUND https://myelasticache.xxxxxxxxx.cache.amazonaws.com indicates that it is trying to resolve https://myelasticache.xxxxxxxxx.cache.amazonaws.com when you want it to use myelasticache.xxxxxxxxx.cache.amazonaws.com.

So try removing https:// and see if it works or if you get another error.