Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to install MongoDb as a service?

Tags:

mongodb

When installing MongoDb, I get the option to install it as a service. What does that mean? If I don't select that option, what difference would it make? Also, selecting "install as a service" will bring up additional options, such as "Run service as a network service user" or "run service as a local or domain user". What do these options do?

like image 666
Logic Avatar asked Aug 29 '18 03:08

Logic


People also ask

Does MongoDB run as a service?

The service will appear to start when you execute net start MongoDB but it will terminate. Check the log files for confirmation that the service has really started. Show activity on this post. Run "cmd.exe" as administrator and then run "sc.exe" to add a new Windows service.

Should I install MongoDB locally?

For those who have confusion. Mongoose used us ODM. So in case you are running locally you should install MongoDB. Otherwise you should supply the MongoDB host ip address.

Where is the MongoDB service?

By default, MongoDB listens for connections from clients on port 27017 , and stores data in the /data/db directory. On Windows, this path is on the drive from which you start MongoDB. For example, if you do not specify a --dbpath , starting a MongoDB server on the C:\ drive stores all data files in C:\data\db .


1 Answers

I'm speaking in the perspective of Windows development, but the concepts are similar with other Operating Systems, such as Linux.

What are services?

Services are application types that run in the system's background. These are applications such as task schedulers and event loggers. If you look at the Task Manager > Processes, you can see that you have a series of Service Hosts which are containers hosting your Windows Services.

What difference does setting MongoDB as a service make?

Running MongoDB as a service gives you some flexibility with how you can run and deploy MongoDB. For example, you can have MongoDB run at startup and restart on failures. If you don't set MongoDB up as a service, you will have to run the MongoDB server every time.

So, what is the difference between a network service and a local service?

Running MongoDB as a network service means that your service will have permission to access the network with the same credentials as the computer you are using. Running MongoDB locally will run the service without network connectivity.(Refer Source here)

like image 150
sthemar Avatar answered Oct 12 '22 08:10

sthemar