Installing MongoDB NoSQL database on Windows OS


MongoDB is a document-oriented NoSQL database application.
It is an open-source cross-platform which thus makes it a free NoSQL database application.
MongoDB is developed by MongoDB Inc which started its development in 2007.
It has some impressive features on File storage with an efficient load balancing and data replication features across multiple machines for storing files.
You can read more on MongoDB from the references at the end of this blog post.
This post will be in two (2) parts
  • Part 1 will focus on how to install the MongoDB NoSQL database on windows operating system
  • Part 2 will focus on how to use the MongoDB. 
So lets begin.....



It is important that you follow the steps carefully as any missed step could result in the database malfunction.
1.  Go to the official website of mongoDB https://www.mongodb.com

2.  Click on download
3. Select "Community Server"

4. Select the operating system of your choice. For this tutorial we will be using Windows Operating System.

5.  Select  "Windows"

6.  Select the Windows version type. The only option available is Windows server 2008 which is sufficient for us

7. Click download



Installation of MongoDB

To beging installation of MongoDB, certain enviroment variables must be defined.

1.  Goto your C drive or any drive of your choice.

2.  Create a folder called MONGODB

3.  Inside the folder create another set of folder called:

  • DATA
  • LOG
  • MDB

4.  Now inside the DATA folder create another folder called DB.

5.  Additionally inside the LOG folder create a file called Activity.log

So we are done with our customisation.
In summary we have the following directory

  • C:\MongoDB\MDB ---- Base installation location
  • C:\MongoDB\DATA\DB  --------  Data files location
  • C:\MongoDB\LOG\activity.log   ---------- Log files location

We can now begin the installation of MongoDB

6.  Open the installation file and click on next


7.  At the Chose Setup Type option, click on Custom buttom

8.  Browse to the directory of your base installation. For me its C:\MongoDB\MDB.

9.  Change the directory of your base installation C:\MongoDB\MDB and Click Next.

10.  Uncheck the Install MongoDB Compass as we will not be using it at this moment. MongoDB compass is the GUI version of the database console. once done Click on Next
11.  Click on install and you are done.


Configuring MongoDB

We will be using the command line utility throughout this tutorial. .

1. Open the Command prompt.

2.  Goto the MongoDB utility located in the following directory:
C:\MongoDB\MDB\bin
your queries will be ran from this location.

3.  Type the following commands:
mongod --logpath C:\MongoDB\LOG\activity.log --logappend

This will set the location where all logs files will be kept.

4.  Type the following commands:
mongod --dbpath C:\MongoDB\DATA\DB 

This will set the data path for the mongoDB and prepare it for taking data. It will listen on port 27017


Running MongoDB Query engine

You can only run commands in your MongoDB enviroment usint the mongo.exe utility. In my case, this mongo.exe utility is located in the environment
C:\MongoDB\MDB\bin
To start writing queries type the following comands
mongo

This will initiate a query prompt for you to start inputing NoSQL queries

And that's it. MongoDB installation is complete.

Its now time to learn how to query the MongoDB NoSQL database.

Click here to learn on how to interact with MongoDB

Goto Part 2


For more reference on installation of Mongodb click here
https://docs.mongodb.com/tutorials/install-mongodb-on-windows/
https://www.mongodb.com/
https://en.wikipedia.org/wiki/MongoDB



Comments

Popular posts from this blog

Auditing Virtualization

How to Identify if the capacity of your FLASH storage device is genuine or counterfeit

Address Resolution Protocol (ARP): Understanding the basics