MongoDB, one of the hottest NoSQL, has now been widely stored in data. This article describes how to perform a standalone installation under Windows.
Environment :
Windows Server 2016 (other versions also apply)
MongoDB 3.6.5
Download :
MongoDB Official Download:
Https://www.mongodb.com/download-center#community
installation :
After the download is complete, you get the following MSI
Double-click Install, always select Next until the installation is complete
Start MongoDB
- Set the data store path and log path, where you can choose to store it under the C drive, or choose to place it in a different directory
C:\>mkdir dataC:\>cd dataC:\data>mkdir dbC:\data>mkdir dbconf
- You build the Windows service, and you apply MongoDB to the Windows service to start the database. Start the cmd command line as an administrator and switch to the Bin subfolder under the folder where the MongoDB database driver is located
Execute the following command:
mongod.exe --bind_ip 127.0.0.1 --logpath "C:\data\dbconf" --logappend --dbpath "C:\data\db" --port 27017 --serviceName "MongoDB" --serviceDisplayName "MongoDB" --install
The command includes many subcommands, each of which requires the following parameters to be written:
"--BIND_IP": the IP address of the binding, subsequent connections to this MongoDB from other records
"--logpath": Log file storage path
"--dbpath": Data storage Road;
"--port": The database occupies the port, the default is 27017;
"--servicename": Windows service Name, set to MongoDB;
"Servicedisplayname": The Windows Runtime service name, where MongoDB is the example.
- Check that the Windows service is created successfully, run inside input services.msc, look for the MongoDB service generated above in the Popup Services window, and check if the service is running. As follows:
Installing MongoDB in the Windows environment