18.05.2016 Views

Mittwoch, 18. Mai, 2016

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How to get started on the MEAN stack 6<br />

Please note that, of course, you have to enter just mkdir data\db, as the C:> is already there, and<br />

I’m including it here just for clarity since I bet all of the readers are familiar with this fact.<br />

Now you have two options for running a MongoDB service:<br />

• running manually<br />

run the mongod binary by executing the following command in command prompt:<br />

C:>mongodb\bin\mongod.exe<br />

This started the MongoDB service on a default 27017 port, and if everything went well you should<br />

see a console output like the one on the screenshot below:<br />

mongod_start<br />

• running as a Windows service this may be a more favorable solution because you won’t<br />

have to start the MongoDB service manually every time you reboot your computer, instead<br />

Windows service will start it automatically after reboot. In order to do so, you first have to<br />

create a log file by executing:<br />

C:>mkdir C:\mongodb\log<br />

Now, create a configuration file by executing:<br />

1 $ echo logpath=C:\mongodb\log\mongo.log > C:\mongodb\mongod.cfg<br />

Next, open up a new command prompt window with administrative privileges (you can do this<br />

by right-clicking on the command prompt icon and clicking on Run as administrator). Finally, to<br />

install the MongoDB as a service execute:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!