Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a web server running in mongo?

When I start the config server I can see the following line in the logger:

[websvr] admin web console waiting for connections on port 27017

So, I wonder if mongo use a web server for maintaining config data?

like image 556
Phalguni Mukherjee Avatar asked Sep 26 '13 14:09

Phalguni Mukherjee


People also ask

What is Mongo web?

MongoDB web interface is a tool used to administrate our database server via the web browser, there are multiple web interface tools available in MongoDB. There is multiple features of the web interface in MongoDB like we can create database and collection by using the web interface.

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.

Is MongoDB NUMA aware?

NUMA (Non-Uniform Memory Access) Architecture Non-Uniform Memory Access is a recent memory architecture that takes into account the locality of caches and CPUs for lower latency. Unfortunately, MongoDB is not “NUMA-aware” and leaving NUMA setup in the default behavior can cause severe memory in-balance.


1 Answers

(All of this assumes you're using the current version of MongoDB, 2.4 or higher)

No, MongoDB does not use a Web server in any way for configuration or administration (as documented here). There is a minimal web server for some other purposes however.

Configuration is done through configuration files or the command line when MongoDB is started.

There is a basic, optionally configured, web page that contains some statistics that may of interest to administrators documented here and called the Http Console. If enabled, it's available by default at http://localhost:28017. It can be disabled via the nohttpinterface option documented here. Also, there is a not recommended for production REST api that can be used for some test and development tasks.

As an example, I just confirmed that the nohttpinterface setting was not set to true in a configuration file (I have a custom port in this example as I have another MongoDB instance already running)

verbose=true
port=25017

I then started MongoDB. In the log file, this was present:

Thu Sep 26 11:11:06.645 [websvr] admin web console waiting for connections on port 26017
Thu Sep 26 11:11:06.645 [initandlisten] waiting for connections on port 25017

Then, I added the nohttpinterface option to the configuration file:

verbose=true
port=25017
nohttpinterface=true

After restarting MongoDB, I could not access the Http Console. The web server was not started (there was no reference to the websvr in the log this time).

Thu Sep 26 11:11:34.028 [initandlisten] waiting for connections on port 25017

Oops! Google Chrome could not connect to localhost:26017

like image 124
WiredPrairie Avatar answered Sep 28 '22 05:09

WiredPrairie