First, introduce the advantages of the following mongodb:
· High scalability
· Distributed storage
· Low cost
· Flexible structure
MongoDB Installation and Environment construction under window platform:
1. Download the installation package or compress package
Official website Download: https://www.mongodb.com/download-center
Download and install directly after installation, select CUSTOMR during installation
2. Adding DB storage and log storage folders
In the place where you like to create a new folder to hold the database files, in this folder also need to create a new three folders (my is under the D disk), a data, a logs, a etc (config), the name can be customized.
Under etc, create a mongo.conf file with the following content:
#数据库路径
dbpath=d:\MongoDB\data\
#日志输出文件路径
logpath=d:\MongoDB\logs\mongodb.log
#错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file
logappend=true
#启用日志文件, enabled by default
journal=true
#这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
quiet=false
#端口号 defaults to 27017
port=27017
#指定存储引擎 (the default is not to add this engine, if the error, we add in)
#storageEngine=mmapv1
To this MongoDB installation complete
3. Add service, configure environment variables, start service
After configuration is executed in cmd
Mongod--config D:\MongoDB\etc\mongo.conf can
Then open d:\MongoDB\logs\mongodb.log to view the log
The prompt in the red box starts successfully.
Every time this startup is a bit troublesome, we can install MongoDB into the service:
Mongod--config d:\MongoDBData\etc\mongo.conf--install--servicename "MongoDB" and then enter
Tip: The above command is performed as an administrator.
Next, execute the MONGO in the bin directory
Next, configure the environment variables:
I believe we all know where to configure the environment variables, here is not more said, see:
At the end of this, enjoy using MongoDB.
Have questions contact qq:412606846 (same number)
MongoDB Installation and Environment construction under window platform