Connect Robomongo to a virtual machine

I have a problem. I am using Virtual Box with RHEL (Red Hat Enterprise Linux) and I have installed MongoDB and Oracle-XE database.

I am trying to connect to my DBs from Windows OS. I can connect to my Oracle database using SQL Developer, however when trying to use Robomongo to connect to my MongoDB, I cannot connect. And I have no idea why.

I have specified port forwarding in both cases, why does one work and the other not?

I've tried the following:

address: localhost port: 27017
address: 127.0.0.1 port: 27017
address: mongo.localhost port: 27017

      

And others ... Why can't I connect to Robomongo?

+3


source to share


2 answers


In ubuntu, I opened \etc\mongod.conf

I have commented bind_ip = 0.0.0.0

before#bind_ip = 0.0.0.0



And as you know, you should use address: 192.168.0.105. port: 27017

(your linux ip; you can get Ip with command> $hostname -I

Maybe the same works for u in RedHat

+7


source


Following the comments bind_ip

in \etc\mongod.conf


You need to do port forwarding

in the VirtualBox setup.
Typically, your VirtualBbox IP will be something like 10.0.2.15


(confirm with a command hostname -I

in the VM)

and suppose the IP address of your pc host 192.168.1.234


(confirm that with command ipconfig

on host pc)

now open your virtual machine settings
click Network

port forwarding




add something like:

Name Protocol HostIP HostPort GuestIP GuestPort
Rule1 TCP 192.168.1.234 27017 10.0.2.15 27017
Rule2 TCP 192.168.1.234 80 & nbsp 10.0.2.15              

now after installing Robomongo connecting IP = GuestIP
you should use the virtualbox address: 192.168.1.234 port: 27017


should now route your request to the right place.

+1


source







All Articles