node.js - AWS MongoDB Instance not reachable from Web Server Instance -


i have 2 ec2 instances first 1 node js app server second 1 mongo db server. cant reach database server app server or else.

i can ping app server(private , public ip adress) mongodb server cant ping mongodb server(private , public ip adress) app server. can ssh both.

the mongodb server has mongod config file network field :

  network     bind: [0.0.0.0, private_ip_of_instance] 

anyway believe cant problem. can access mongo db within instance , query well. status of mongod service on mongodb server active.

the output log of mongo db instance says

 waiting connections on port 27017 

my nodejs environment on app server has config file points private_ip of mongo db server instance on port 27017 along database name.

the ufw firewall of mongodb instance has following status

22                         allow       anywhere 27017                      allow       public_ip_address 27017                      allow       private_ip_address 80/tcp                     allow       anywhere 22 (v6)                    allow       anywhere (v6) 80/tcp (v6)                allow       anywhere (v6) 

so dont believe mongodb server firewall blocking connections.

the security group of mongodb instance configured allow access anywhere on port 80. have tried pining public ip of mongdb instance local machine packets lost , can ping public ip of app server , no packets lost.

its weird cause working before. app server talking mongodb server , fetching data , returning till today.

you need open port 27017 in security group assigned mongodb server.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -