简体   繁体   中英

Amazon AWS Elastic Beanstalk - connect to mongodb

I have a node.js app running on aws elastic beanstalk with a load balancer. Currently, I only have one instance running and it can connect to a mongo database instance because I have opened up a port using eb instance internal ip address.

However, as I spin up more nodes on eb, they will have different/new internal ip addresses. What is the best way to allow/open the ports for these new instances?

I recommend using VPC for that. You will place your node servers in zone 1 and mongo instance(s) in zone 2. You then allow zone 1 to access mongo port in zone 2. Elastic Beanstalk will spin up instances only in zone 1, so any internal IP assigned to them will be ok for that configuration, and no one from the www can access mongo.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo-vpc.html

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