9

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

vmr
  • 1,895
  • 13
  • 24
hardik dave
  • 93
  • 1
  • 5
  • Are u trying to connect with SSH? Need more info, can you post a snapshot of how you are trying to connect. – vmr May 15 '15 at 07:35
  • On aws VM i am connecting with SSH. And with robomongo i am trying to connect aws VM but showing Unable to connect to mongoDB – hardik dave May 15 '15 at 08:06
  • Looks similar to this issue : http://stackoverflow.com/questions/24392320/not-able-to-connect-robomongo-with-amazon-instance – vmr May 15 '15 at 09:12

2 Answers2

10

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 here enter image description here

efkan
  • 12,991
  • 6
  • 73
  • 106
1
  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)

Sanyam Jain
  • 2,925
  • 2
  • 23
  • 30