MongoDB Learning installation in Windows environment

Source: Internet
Author: User
Tags mongodb commands mongodb server

MongoDB Official Download Station is http://www.mongodb.org/downloads, can go up to download the latest program down.

As you can see on the download page, the operating system support is comprehensive, OS X, Linux, Windows, Solaris are all supported, and all have their own 32-bit and 64-bit versions. The current stable version is version 2.6.4.

Attention:

1. MongoDB 2.6.4 Linux requires glibc must be above 2.5, so you need to first confirm the glibc version of the operating system.

2. on 32-bit platforms MongoDB does not allow database files (cumulative sum) to exceed 2G, while 64-bit platforms do not have this limitation.

a) Download MongoDB

Download the Windows 32-bit version and unzip, the program files are in the bin directory, the other two directories are C + + calls are header files and library files. The bin directory contains the following programs:  
Bsondump: Dumps files in Bson format to JSON-formatted data
MONGO: The client command line tool, in fact, is also a JS interpreter, support JS syntax
Mongod: Database server, each instance starts a process that can fork to run in the background
Mongodump/mongorestore: Database backup and recovery tools
Mongoexport/mongoimport: Data export and Import tool
Mongofiles:gridfs management tool for access to two files
MONGOs: Shard Route, if the sharding feature is used, the application connects MONGOs instead of Mongod
Mongosniff: This tool works like tcpdump, except that he only monitors MongoDB-related packet requests and is output in the form of a specified readability
Mongostat: Real-time performance monitoring tool

II) set up MongoDB working directory

Unzip it to C #, then rename it to MONGO, and the path is C:\mongo

III) Set the data file path

Create a new logs and data folder inside C:\mongo

Create a new Mongodb.log file inside the c:\mongo\logs, create a log file

Create a new folder in C:\mongo\data DB, set up a data storage directory

IV) Start MONGODB service

Open cmd, enter command: C:\mongo\bin\mongod.exe--dbpath=c:\mongo\data\db

The following information is displayed for normal operation:

Mongdb The default listening port is 27017.

If no information is requested, MONGDB displays a message every 5 minutes.

Enter http://localhost:27017/in the browser. will appear

You is trying to access MongoDB on the native driver port. For HTTP diagnostic access, add the port number

Indicates that the service has started.

V) random startup of Mongdb as a Windows service

1. CMD input command: C:\mongo\bin\mongod.exe--path=c:\mongo\data\db--logpath=c:\mongo\logs\mongodb.log--journal--install

Under normal circumstances, the following information is displayed: all output going to:c:\mongo\logs\mongodb.log

2. Turn on the service, enter command net start MongoDB

Under normal circumstances, the following information is displayed:

Stop service, Input command: net stop MongoDB

Delete Service, enter command: Mongod--remove

vi) Client connection to MongoDB service

1. Open a new CMD window, enter command: C:\mongo\bin\mongo

The following information appears to indicate that the connection was successful:

Mongovue is a visual tool that is equivalent to the plsql we are familiar with, but can also perform operations on the database.

VII) Problems in the installation process

1. If an error occurs:

First look at the service start No, if there is no start service first start the service, if the service has been started, it is possible that the last abnormal shutdown MONGO, causing the file to hold the data is occupied, locked. Simply remove the Mongod.lock file from the c:\mongo\data\db. Restart the service.

Summary: MongoDB does not need to be installed, only need to create the server's startup environment: The Bin folder is required (for some of the MongoDB commands), specify the location of the database and log location, create a log file. With this, the MongoDB server side can be started.

MongoDB Learning installation in Windows environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.