Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect aws VM running mongo DB to robomongo on windows machine?

I am trying to access my mongodb databases which are running on VM on amazonaws. I am trying to connect through robomongo. Getting can not connect.

I have checked that mongoDB listening to 27017 and commented bind_ip = 0.0.0.0 to #bind_ip = 0.0.0.0 in mongodb.conf in /etc/mongodb.conf

like image 238
hardik dave Avatar asked May 15 '15 07:05

hardik dave


2 Answers

If your MongoDB version pre-3.0, so your MongoDB uses MONGODB-CR Authentication then you can use Robomongo today. Otherwise RoboMongo cannot be used yet. (2015-05-16) Because MongoDB 3.0 uses SCRAM-SHA-1 credentials. (https://github.com/paralect/robomongo/issues/766)

To Connect MongoDB 2.6 and Earlier Versions Using Robomongo Directives;

  1. Open mongod.conf file using sudo nano /etc/mongod.conf command. Then mark as comment line port line like the following;

    # port = 27017

    Use CTRL + X to save file and exit.

  2. Create a user that will be used on RoboMongo

    db.createUser({ user: "admin", pwd: "GiveASecretPassword", roles: [{ role: "clusterAdmin", db: "admin" }, { role: "readWrite", db: "config" }]})

  3. Allow port 27017 on Security Groups page on your EC2 console.

enter image description here

  1. Create a new connection on RoboMongo

enter image description hereenter image description here

like image 178
efkan Avatar answered Nov 15 '22 20:11

efkan


  1. Comment bindip in /etc/mongod.conf
  2. Find ip address of your vm
  3. Open custom TCP rule in AWS to listen to port 27017

Note:
Requires only IP address & port to connect to mongodb. (Use connection tab in robomongo)

like image 45
Sanyam Jain Avatar answered Nov 15 '22 20:11

Sanyam Jain