Why can’t I open the Mongodb interface on port : 28017?

Asked

Viewed 1,693 times

4

I installed Mongo in the C drive and did some data creation tests and persisted,then consulted and there they were perfectly listed at the prompt.
So far so good!
I open the browser and type localhost:27017 and appears the message of life sign:

It looks like you are trying to access MongoDB over HTTP on the native driver port.  

But when I try localhost:28017 only see:

Esta página da web não está disponível  

What should I do?

  • 1

    Vc configured the Mongodb web panel to respond to port 28017?

  • @Thiagolunardi Thanks for your attention. How would I do just that? I’m using version 2.6.11

  • I never did, the case is that by default Mongodb sets up his websetup at port 27017, not at gate 28017. That’s why you get a 404, because there is no web application responding on this port.

  • 1

    What are you trying to do Pena? If you want to query data via browser, you should add the --rest when you run Mongo. After that you can access through http://localhost: 28017/mydb/mycollection/ and apply the filters that are needed.

  • @Thank you, my friend! I’m a beginner in NOSQL, is that I saw in an installation tutorial the guy navigating the port 27017 and also 28017, and when I tried to do the same, I couldn’t!! He didn’t teach you how to do that!! Where do I type the command you mentioned? I have two open terminals with mongod and other with Ngo where I work visualizing the data!

  • 1

    Now this Feather, try to stop the mongod and run something like this again: mongod --dbpath /data/db --rest or else if you are not specifying any argument just do mongod --rest

  • @Andrévarandas Genius, it worked!! you could have answered the question comrade!! Answer!! Arigato! ,Sayonara!! -

Show 2 more comments

2 answers

3


Mongodb exposes an http interface, through which we can check its status using port 28017.

To access via browser, the command --rest should be passed to mongod, as an example:

mongo --dbpath /data/db --rest

Then open your browser:

http://localhost: 28017/mydb/mycollection/

Important: This interface should never be used in a production environment.

More information on this official page Mongodb Http Interfaces

2

Edit the file /etc/mongodb.conf

sudo nano /etc/mongodb.conf

add the line:

rest = true

inserir a descrição da imagem aqui

restart the service

sudo mongod restart

Ready. Now the door is serving REST.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.