In recent days I was working on MongoDB, a document based, non-relational database provider. In cases it is 100 times faster the the traditional database. But still I will not say it will broadly replace the traditional RDBMS. I would obviously say it worth a very important gain in sense of PERFORMANCE and Scalability. MongoDB has distinctive advancement over the traditional RDMS databases ( provider: MS-SQL, Oracle, MySQL) which are:
1) Ease of Use (Developer Friendly)
2) Light weight
3) Faster, Faster, Faster.
I would like to write several post on why we should use MongoDB or why shouldn’t and also on the performance comparison on MongoDB Vs Other RDMS provider. But I would like to write about how we could install mongoDB.
However, to get a head start you can read:
1) To install MongoDB we need to get the mongoDB source code: Go to MongoDB Download
I have downloaded the Windows 32-bit version of 1.4.2
2) Now place the unzipped code in a easily accessible location. (For may case : C:\MongoDB\(Unzipped content)
3) By default MongoDB will store your database files in C:\data\db. So don’t forget to create the folder in that location. You can change this default location if you wish to.
4) Now we can actually run Mongo in two mode
i) From Command Prompt
ii)As Windows Service
If you run from command prompt you have to repeat this step every time you run Mongo. So, I would suggest and discuss here how we can install mongo as Windows service. This will ease the mongoDB start process for you.
To Install as Windows Service:
i) Open the Command Prompt and change your command prompt directory to bin folder of the mongoDB folder.
for my case its: cd C:\MongoDB\bin
ii) Now type: C:\MongoDB\bin> mongod –-install
iii)Now type: C:\MongoDB\bin> mongod ––service
5) Open the Service manger window and Look for mongoDB service :
So, now your service is installed but its not started yet. Trying to start it will give you following error: \
6) So to correct it :
Go to RUN prompt and type : regedit for registry editor
7) Now traverse for the following location in the Registry Tree:
8) Now set the Image Path as your specified location:
for may case:
Now Again start your Service. The service should run successfully.
To be sure that mongo is up and running type: http://localhost:28017
Hope this helps. Happy Development.