Thursday, 5 September 2013

Installing and Configuring MongoDB server on Windows



Steps to Install MondoDB server on windows

1. Download the archive from MongoDB website.

2. Un-archive the file downloaded in Step 1. Choose a directory as per your convenience.
    Lets choose C:\MongoDB and un archive the file here.

3. Create a directories required by the MongoDB server.
    i. First create data directory inside the C:\MongoDB.
    ii. Secondly create log directory  inside the C:\MongoDB.

Note: MongoDB does not create any directories by default. We have to create these directories to enable MongoDB server (mongod.exe).

4. Create a config file pointing to the directories created in Step 3 and lets name it mongo.config.
   
  Add following contents to the  mongo.config file.

   #path to data directory
   dbpath=C:\MongoDb\data

    #path to log file - remember its a file not directory
   logpath=C:\MongoDb\log\mongodb.log

   #used for logging read and write operations
   diaglog=3

5. Add the path of MongoDB executable i.e. bin directory to PATH system environment variable.


6. Now lets start the MongoDB server using the config file create in step 4.

mongod.exe --config C:\MongoDB\mongo.config













In the next article I will show you how to create new DB and simple documents in MongoDB.

This article is written by +Vikram Takkar and published on www.vikramtakkar.com, please let me know, if you see this article on any other website/blog.

No comments:

Post a comment