简体   繁体   中英

I can't connect Elasticache to Elastic Beanstalk (In VPC)

I have a VPC with 2 public su.nets in different availability zones (public su.net-2a and public-su.net-2b). I have two private su.nets (private-2a-EB-Instance, private-2b-EB-Instance), and two other private su.nets for Elasticache (private-2a-EB-Instance, private-2b-EB-Instance), these two su.nets for elasticache are part of a su.net 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM