First, write in front
Historically, the relational database has been used. It was also very early to hear that when the data volume is large, the relational database will have many problems to use. such as slow query data, loading time is long, and so on.
Has long heard of nosql (NoSQL = not-only SQL), which refers to non-relational databases. This type of database is primarily stored as a hash table. That is, the table has a specified key and a pointer to the specific data, key, value key-pair mode. The benefits of this approach are simple and easy to deploy.
In the NoSQL database, there are mainly Cassandra, MongoDB, CouchDB, Redis, Riak, Membase, neo4j and HBase, among which MongoDB is most commonly used. So little gossip, step into the chase. Below is a description of how to download and install the MongoDB development environment under Windows systems.
Second, download and install
1. First login to the MongoDB website (http://www.mongodb.org/downloads) to download the latest installation package (32-bit/64-bit) for your system.
2. After downloading, in the D Disk new folder MongoDB, unzip the installation package in the folder.
3. Under current directory, create a new database directory D:\MongoDB\data. Next open the CMD Command Line window and switch to the D:\MongoDB\bin directory to execute the following command:
Mongod--dbpath D:\MongoDB\data
After entering the command, some startup information appears, and the last line prompts:
Waiting for connections on post 27017:
Admin Web Console waiting for connections on post 28017.
4. In the Browser address field, enter: localhost://27017 to test the connection.
5. Page access prompt is successful. At this point, MongoDB installation is finished, much simpler than imagined.
III. Installation of Windows services
In order to be able to start and close more conveniently, we will mongodb install bit Windows service.
The specific commands are as follows:
Mongod--dbpath D:\MongoDB\data--install
The prompt message appears:
--install have to is used with--logpath
As prompted, we need to specify the log directory. So we create the log directory D:\MongoDB\logs and then re-execute the command. However, the same message appears.
By querying the information online, you can create a service by using the SC command.
Specific command Help information:
Enter the command as follows: (Note: To enter a command in the C:\Windows\System32 directory)
SC create MongoDB binpath= "D:\MongoDB\bin\mongod.exe--service--dbpath D:\MongoDB\data--logpath=d:\mongodb\logs\ Mongodb.log --logappend "
Created successfully
In order to better see whether the service is really successful, we can right-click on the computer--management--services, view:
You can start the service manually, or you can enter the command line:
net start MongoDB
Iv. configuration file creation and setup
MongoDB has been made by us to serve, and later to launch a lot of convenience. However, this is not the end, we also have to manually create a configuration file.
- Create profile Directory D:\MongoDB\etc
- Setting up the configuration file D:\MongoDB\etc\mongodb.conf
Fill in the contents of the configuration file:
Dbpath=d:\mongodb\data #数据库路径logpath =d:\mongodb\logs\mongodb.log #日志输出文件路径logappend =true #错误日志采用追加模式, When this option is configured, the MongoDB log is appended to the existing log file instead of the new file Journal=true #启用日志文件, Quiet=true #这个选项可以过滤掉一些无用的日志信息 is enabled by default, If you need to debug use set to falseport=27017 #端口号 default to 27017
Only a few more commonly used options are specified above, please refer to the official documentation for more detailed configuration http://docs.mongodb.org/manual/reference/configuration-options/
Finally, specify the log for the MongoDB service on the command line:
Mongod--config D:\MongoDB\etc\mongodb.conf
V. Final and final
At this point, MongoDB download installation and configuration is basically finished.
The next blog post, will show you how to carry out the basic operation of the database (gift and deletion check). The wrong place, welcome treatise, thank attention!
1. Preliminary discussion on mongodb--Introduction, Installation and configuration