How To Install Mongodb on Windows

Following are the few steps to install the mangodb in windows system:
1. Software/OS requirement
1.1 Operation System (OS) > Windows
1.2 MangoDB 2.6.7
      Download from Click me.
2. Unzip it in c:\mongodb

   
 








    Directory location and files look like above.
3. c:\mongodb\bin look like below
 


















4. Create the data directory inside the c:\mongodb
5. Create the log directory inside the c:\mongodb
6. Create the mongo.log file in c:\mongodb\log
    Open the notepad and create new file and save as "mongo.log"
 













7. Create the MongoDB config file, it is just like notepad file but make sure save it with .config      extension.
c:\mongodb\mongo.config

################################################
####MongoDB data will store in this location
dbpath=c:\mongodb\data

####loglocation
logpath=c:\mongodb\log\mongo.log
###############################################





8. Run the Mongodb Server
Open the command prompt Start > Run > Type cmd and enter
c:\your user name\nameofuser>cd c:\mongodb\bin
c:\mongodb\bin>dir
 Volume in drive C has no label.
 Volume Serial Number is CC5F-C2A5

 Directory of c:\mongodb\bin
 23/02/2015  16:23    <DIR>          .
 23/02/2015  16:23    <DIR>          ..
 23/02/2015  16:23        18,883,072 bsondump.exe
 23/02/2015  16:23        10,147,328 mongo.exe
 23/02/2015  16:23        19,034,112 mongod.exe
 23/02/2015  16:23       129,944,576 mongod.pdb
 23/02/2015  16:23        18,941,440 mongodump.exe
 23/02/2015  16:23        18,891,264 mongoexport.exe
 23/02/2015  16:23        18,909,184 mongofiles.exe
 23/02/2015  16:23        18,920,960 mongoimport.exe
 23/02/2015  16:23        18,882,048 mongooplog.exe
 23/02/2015  16:23        18,741,760 mongoperf.exe
 23/02/2015  16:23        18,961,408 mongorestore.exe
 23/02/2015  16:23        15,303,168 mongos.exe
 23/02/2015  16:23       103,984,128 mongos.pdb
 23/02/2015  16:23        18,931,712 mongostat.exe
 23/02/2015  16:23        18,885,120 mongotop.exe
              15 File(s)    467,361,280 bytes
               2 Dir(s)  165,097,476,096 bytes free

c:\mongodb\bin>mongod.exe --config c:\mongodb\mongo.config
2015-02-23T17:33:59.950+0000 warning: --diaglog is deprecated and will be removed in a future release
2015-02-23T17:33:59.951+0000 diagLogging level=3
2015-02-23T17:33:59.951+0000 diagLogging using file c:\mongodb\data/diaglog.54eb6487
2015-02-23T17:33:59.952+0000 log file "C:\mongodb\log\mongo.log" exists; moved to "C:\mongodb\log\mongo.log.2015-02-23T17-33-59".

Now mongodb got started.

9. Run the Mongodb client
Open the command prompt Start > Run > Type cmd and enter
c:\Users\username>cd c:\mongodb\bin
c:\mongodb\bin>mongo.exe
MongoDB shell version: 2.6.7
connecting to: test
>

Now Mongodb client connected with default test database.

Thanks for your valuable input if any.

No comments:

Post a Comment