Quantcast
Channel: User mbaird - Server Fault
Viewing all articles
Browse latest Browse all 8

Answer by mbaird for AWS, NodeJS - Connecting app to Mongodb on another EC2 instance

$
0
0

Your issue is that you are using the public elastic IP to connect to your database server from your other servers. This means that the connection is going out to the internet and back into your VPC, which presents the following issues:

  1. Security issues due to the data transmission not being contained within your VPC
  2. Network latency issues
  3. Your database server's security group can't identify the security group of the inbound connections

Get rid of the elastic IP on the MongoDB server, there is no need for it unless you plan to connect to it from outside your VPC. Modify your servers to use the private internal IP address assigned to your database server when creating connections to it. Finally, lock your security group back down to only allow access to the DB from your other security group(s).

Optional: Create a private hosted zone in Route53, with an A record pointing to your database server's private IP address, then use that hostname instead of the internal IP address.


Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>