Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser can't access MongoDB on 27017

I have some issues with MongoDB (or Linux security, perhaps):

1 I am runing MongoDB 3.0 in an OpenSuSE 13.1 machine (which acts as the data server). I have a local network of 4 computers with different OSs.

2 I can connect from a Windows 8.1 Laptop using the mongo command, using the pymongo Python library, or Robomongo. Everything works just fine: I can query the server and insert things.

3 However, when I try to access port 27017 to see the "It looks like you're accessing..." message, the browser says "The connection was reset".

4 SuSe's Firewall and AppArmor are disabled.

QUESTION: There is one computer that can't access the address of the local server. Said computer is in the same local network and is running Windows 8.1. I tried with many other devices and OSs (see miniupdate in comments) and they all managed to access the 27017 port on the server. Of course, the server simply displayed the message "It looks like you are trying to access MongoDB over HTTP on the native driver port.". Do you have any ideas as to why the browser in the problematic computer keeps saying "Connection was reset" instead of showing the message mentioned above? Please note that this computer can do everything I mentioned in point 2. It's the browser thing that is puzzling me.

like image 272
A R Avatar asked Apr 02 '15 04:04

A R


People also ask

How do I access MongoDB from browser?

By default, MongoDB starts at port 27017. But you can access it in a web browser not at that port, rather, at a port number 1000 more than the port at which MongoDB is started. So if you point your browser to http://localhost:28017, you can see MongoDB web interface.

Can't connect to found database localhost 27017?

0.1 : 27017 ” is a general error message indicating that your client/driver cannot connect to a server on the specified hostname/IP and port. In this specific example, 127.0. 0.1 is the hostname or IP and 27017 is the port. Your connection from client to server is blocked by firewall or network configuration.

Why is my MongoDB not connecting?

If you have created a user and are having trouble authenticating, try the following: Check that you are using the correct username and password for your database user, and that you are connecting to the correct database deployment. Check that you are specifying the correct authSource database in your connection string.

How do I connect to localhost 27017?

To connect to your local MongoDB, you set Hostname to localhost and Port to 27017 . These values are the default for all local MongoDB connections (unless you changed them). Press connect, and you should see the databases in your local MongoDB.


1 Answers

MongoDB's default port doesn't speak the http protocol. Which is what a browser can speak (among a few others). If you're looking for the web based status page, then that should be on port 28017 (27017 + 1000).

See http://docs.mongodb.org/manual/reference/default-mongodb-port/ for more details.

like image 160
kashyap Avatar answered Sep 30 '22 14:09

kashyap