Unable to get MongoDB instance hosted in RoboMongo Google Virtual Machine

I created a project and deployed the MEAN stack using "Click to Deploy". When I visit <> / 3000, I see the MEAN page coming from the server. I can also ssh to this machine and see everything there. This way I can access the MongoDB instance.

I also created a separate virtual machine where I myself installed Node.JS and MongoDB. Both work the same way.

My problem: I can’t access any of the machines in my local RoboMongo instance, I can’t access them from the local shell. I had a similar problem in the aws world and the solution was to create a security group to resolve the mongodb port (27017). So I tried this and added a “firewall rule” in the “Network” section and allowed this port for all incoming streams → as below

Message mongodb from the outside Source ranges: 0.0.0.0/0 Allowed protocols or ports: TCP: 27017 But the problem persists, and I can not access the mongodb instance from robomongo or the local shell.

Any idea?

+4
source share
2 answers

, MongoDB 27017, :

sudo netstat -nap | grep 27017

, IP- , , . , , - bindIp db.serverCmdLineOpts()

+1

bind_ip = 0.0.0.0 mongod mongod.conf

fork = true
bind_ip = 0.0.0.0
port = 27017
quiet = true
dbpath = /srv/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true
journal = true

mongo

sudo mongod --config /etc/mongodb.conf

Mongo Google IP- 27017 .

+1

All Articles