MongoDB Compass connectivity issue with Ec2 Instance to access amazon documentDB cluster - mongodb

I have been trying to access my database that i created on Amazon DocumentDB via MongoDB Compass using Ec2 Instance but following is the error I keep on getting. There are no issues with the security groups, since I have made sure to give appropriate in bound request rights.
I am able to connect to the DocumentDB cluster via mongo shell after I SSH into the ec2-instance, but I cannot connect it via MongoDB Compass because it throws me the same error that has been attached in the image below
Please help!

Just use your pem file and set localhost port example here port 8000. Once run this below command then just open mongo compass and host: localhost:8000 then it will connect.
ssh -i my-aws-key.pem -N -f -L 8000:localhost:27017 ec2-user#serverIp

Related

MongoDB Atlas Cannot get console mode 6

I get this error in my terminal whenever I try connecting to MongoDB Atlas. Actually, I have my IP whitelist to 'Allow access from anywhere'. I don't know why i'm getting this problem.
I also tried:
$ mongo "mongodb+srv://cluster0-cueit.mongodb.net/test" --username <usrnm> --password <pwd>
but it gives me different error.
It looks like this is a MongoDB Atlas cluster. Please ensure that your
IP whitelist allows connections from your network.
It should be active and 0.0.0.0/0 (includes your current IP address) under Network Access

How to connect to DogitalOcean Droplets database with MongoDB Compass?

I have a flask app with mongoDB running on a digital ocean's droplet, and now I need to see what's inside that database.
I'm trying to connect with mongoDBCompass, but no tutorial seems to help me.
If there's another easier way to access that data, it would be helpful too.
You have several options:
Connect MongoDB Compass via an SSH tunnel.
Or use SSH tunneling with e.g.:
ssh -L <local_port>:<mongodb_hostname>:<mongodb_port> <user>#<bastion_hostname> -fN
and connect MongoDB Compass via localhost:<local_port>.
Or use the mongo shell directly on your droplet.
Or open the mongo port (typically 27017) via an inbound firewall rule and connect your favorite client to your droplets public IP.

Connect to EC2 mongo server

I have been facing this issue since so long. I want to connect to compass or any mongo GUI tool to EC2 mongo server. I have bind_ip 127.0.0.1 in mongo.conf and don't want to open for all IP.
I have tried connecting to the server through SSH but get "MongoDB not running on the provided host and port" error. Please anyone can help to connect remotely to MongoDB server.

Connect mongodb server via robomongo from another PC

I am using mongodb database for my meteor app. I want to access it from another pc. I have mounted my local as a virtual drive on other PC using ssh. Now I want to connect to mongodb via robomongo. I have given the address as 192.168.1.2:4001 (ip addr of local : port on which meteor is running +1). But its giving an error 'Unable to connect to mongodb'. How to proceed?
The other way around is to start your meteor on a regular mongo server with this command :
MONGO_URL=mongodb://localhost:27017/nameOfDatabase meteor
Be sure to have a running mongo on localhost and to change the nameOfDatabase.
Now it's just a regular mongoDB server to connect. Also you might need to add login and password to that mongo url and the debug parameter after meteor if you use packages like meteor toys.
Please check mongodb's config file /etc/mongod.conf and comment out bind ip
net:
#bindIp: 127.0.0.1
port: 4001
Restart mongodb service. This will allow mongodb to bind to ip's other than localhost.

JDBC connection to mongodb running on Meteor server on Cloud 9

I have a Meteor app running on Cloud 9 and I would like to connect to MongoDB from a window app that I am in trial period (DBSCHEMA: http://www.dbschema.com/).
Cloud 9 guys told me that I need my DB to listen to 0.0.0.0:8082.
In cloud9 I started my app using command: $ meteor --port $IP:$PORT.
I also created a db and user that has role "userAdmin" to this database.
In another terminal, at c9, "Meteor mongo" command give me connecting to: 127.0.0.1:8081/meteor
In DBSchema ping to the server is succesfull, but connection is refused.
So, I am trying to change to 0.0.0.0:8082 but I cant figure out how and not sure its going to work.
Any suggestions please?
use environment variable MONGO_URL=your-mongo-server-ip-or-hostname:8082 in meteor and start mongo with port 8082 on 0.0.0.0 with the config file
http://docs.mongodb.org/manual/reference/configuration-options/
Ideally, you should not expose you dB to the outside (so not bind to 0.0.0.0 which exposes the DB on all interfaces including the public IP).
If you want to access it with Robomongo, bind to localhost, and then you should create a ssh tunnel to the server from you local terminal with the command
ssh -L 8082:localhost:8082 your-host
then connect to it with robomongo at localhost:8082 –