MongoDB is a #NoSQL, open-source and document database designed for ease of development and scaling. It uses documents instead of records, and it is recommended for systems which generate large amount of data (in Big Data scope).
MongoDB is available for all platforms and operative systems. Intallation is explained here. We are going to focus on the Windows OS installation and configuration with some “extra” features.
- Download the .msi installer (according to your Windows version) from here.
- Choose “Custom Installation” to install mongodb in C:\mongodb folder.
Open a terminal and create these folders to save several mongo files:
Create a configuration file (mongo.config) in the root folder with this information:
bind_ip = 127.0.0.1
port = 27017
(Create “\db” and “\log” folders in “mongodb\data” if was necessary)
Start and test mongodb
Connect to mongo. Open a new terminal as administrator and execute mongo command (
Install MongoDB as a windows service:
- Run command
sc create MongoDB binpath="\ "C:\mongodb\bin\mongod.exe" --service --config=\"C:\mongodb\mongo.config"" DisplayName="Mongo Standard"
If services was successfully created, the following log message appears at the prompt (
[SC] CreateService SUCCESS)
Also, you can start and stop the service from the command line with these commands:
net start MongoDB
net stop MongoDB
To remove MongoDB service, run the command
sc delete MongoDB