I am trying to connect Robo 3T to my online database and it doesn't seem to be working. I am able to connect to local database with it. I tried connecting using MongoDB Compass and the Details and Auth are working fine and I am able to connect. But when I connect with the same details in Robo 3T, it doesn't seem to be working. How do I fix this? I am using Robo 3T Version 1.1 I tried same with Robomongo 1.0, and still getting the same error
问题:
回答1:
Just change your bind_ip in /etc/mongod.conf from 127.0.0.1 to 0.0.0.0 then restart the service, and it works for me~
回答2:
If you get the following error then you should also check the following:
The atlas servers at least require this setting, if you do not choose it, then you generally get the Network is unreachable message.
Also if you are using Atlas then you should check the Authentication tab and select SCRAM-SHA-1, however this generally results in an authentication error not a network unreachable one.
回答3:
A better solution is to comment out or remove the bindIp setting from the config file /etc/mongod.conf
You must restart the service for the change to take effect
回答4:
I also meet this problem when I use Robo 3T on Mac. I think there are some things you need to check to help you know what's the problem.
First try to ping
the mongo server in your terminal to see whether you can get responses. If so, that's means you may set wrong mongo config in you Robo 3T.
If you cannot get the response, that means there is something wrong with your network. You should check your DNS and your network gateway. For example my DNS is 172.16.*
and my network gateway (execute ifconig
and check en0
) is 172.17.*
. And they are not belong to the same network segment. (Actually, even if they are on the same network segment, things won't work if someone polluted your DNS server.)
That's the problem. The DNS that you are using cannot interpret your mongo host correctly. Someone may had polluted this DNS server.
You can have a try on ping xxx(your mongo-server) @8.8.8.8
, which will use 8.8.8.8 as your DNS. If everything goes well, then you get the sollution.
Sollution: Manually set DNS for your devices. For example, Google's public DNS, 8.8.8.8 and 8.8.4.4.
Actually, if you run dig xxx(your mongo-server)
before and after you manually set DNS, you may find the response Ip differently.
回答5:
I had this symptom, and the ultimate fix is not yet captured in an answer here.
I was trying to connect to a mongo instance in the cloud using Robo 3T, and I was getting the "Network is unreachable" message.
Oddly, I could connect from using Robo 3T inside a Parallels VM on the same machine.
This led me to try the full Studio 3T on my mac, which could also connect just fine.
Ultimately, I discovered that there was an old dotfile from an ancient version of Robomongo that was causing the problem. rm -rf .config/robomongo
did the trick. Now I can connect with the ordinary, free Robo 3T.
I'm guessing that I had an expired trial of Robomongo, from back before it was free, perhaps?
回答6:
This means mongo server is not started.
You need to run mongod
command on the terminal to start the server.
if you do not have mongo db installed on your machine. Download and install from the Link.
回答7:
Start your command prompt on windows.Go to the bin folder of Mongodb through command prompt and type mongod and enter.Now try to access again
回答8:
As said above, this is probably due to BindIp, if you use mac and brew to install it you won't find anything in /etc/mongod.conf instead you find it in /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: /usr/local/var/mongodb
net:
bindIp: 127.0.0.1
Change BindIp with caution!
And same goes for running it, to start MongoDB manualy use:
mongod --config /usr/local/etc/mongod.conf
or configure autostart on login with launchd by typing:
brew services start mongodb
I've also encountered corrupted data files on my local computer here:
/usr/local/var/mongodb
just removed them and it worked, you could see in the log that errors like:
** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.6 before attempting an upgrade to 4.0; see http://dochub.mongodb.org/core/4.0-upgrade-fcv for more details.
2018-08-01T00:15:50.220+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2018-08-01T00:15:50.220+0200 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-08-01T00:15:50.224+0200 I STORAGE [initandlisten] WiredTigerKVEngine shutting down
2018-08-01T00:15:50.303+0200 I STORAGE [initandlisten] Downgrading WiredTiger datafiles.
2018-08-01T00:15:50.501+0200 I STORAGE [initandlisten] WiredTiger message [1533075350:501686][3594:0x7fffb492e380], txn-recover: Main recovery loop: starting at 14/3712
2018-08-01T00:15:50.598+0200 I STORAGE [initandlisten] WiredTiger message [1533075350:598867][3594:0x7fffb492e380], txn-recover: Recovering log 14 through 15
2018-08-01T00:15:50.664+0200 I STORAGE [initandlisten] WiredTiger message [1533075350:663976][3594:0x7fffb492e380], txn-recover: Recovering log 15 through 15
2018-08-01T00:15:50.715+0200 I STORAGE [initandlisten] WiredTiger message [1533075350:715398][3594:0x7fffb492e380], txn-recover: Set global recovery timestamp: 0
2018-08-01T00:15:51.002+0200 I STORAGE [initandlisten] shutdown: removing fs lock...
2018-08-01T00:15:51.005+0200 I CONTROL [initandlisten] now exiting
2018-08-01T00:15:51.005+0200 I CONTROL [initandlisten] shutting down with code:62
回答9:
Start the MongoDB service from the task manager. Worked for me.
In my case both mongod and mongo.exe was throwing a 100 error code.