Version selection
MongoDB version naming specifications such as: x.y.z;
- Y is an odd number to indicate that the current version is a development version, such as: 2.3.0, 2.1.1;
- Y is even when the current version is stable version, such as: 2.0.1, 2.2.0;
Currently the latest version of the official website is 3.4.6
Platform Selection
- Production environment using 32-bit machine data limit 2G, on 64-bit machine to use the 64-bit version, you can obtain a larger memory mapping space, improve the performance of MongoDB;
- As for the operating system, MongoDB is cross-platform, in the download page to find their corresponding version can be.
Installation of the Windows platform
- Download the corresponding version of the installation package to the MONGODB website: https://www.mongodb.com/download-center?jmp=nav#community
- Set up the MongoDB folder in the D disk, set up the Data\db folder as the storage path of the data file under the MongoDB file, establish the logs folder to store the log file.
- Install MongoDB under the D:\MongoDB path.
NEXT:
Here you need to change the installation path for the next MongoDB database, as shown in:
Installation is complete.
Start cmd in administrator mode, switch to MongoDB's installation directory, and execute the command: Mongod--dbpath "D:\mongodb\data\db"--logpath "D:\mongodb\logs\log.txt"-- Install-servicename "MongoDB"
About parameter Descriptions in commands
Parameter description
--BIND_IP bind service IP, if bind 127.0.0.1, then only native access, do not specify default local all IP
--logpath the MongoDB log file, note that the specified file is not a directory
--logappend writing the log using the Append method
--dbpath Specifying the database path
--port specifying the service port number, default port 27017
--servicename Specifying the service name
--SERVICEDISPLAYNAME Specifies the service name, which is executed when there are multiple MongoDB services.
--install is specified as a Windows service installation.
As shown in the following:
Next, start the MongoDB service as shown in:
After entering the MongoDB database shell:
To exit the MongoDB database shell:
MongoDB installation and startup under Windows system