Wednesday, October 8, 2014

MongoDB windows 8 installation

  • Download from https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.4-signed.msi?_ga=1.92201882.1006826747.1412750869
  • Install downloaded msi
  • Move installed directory from default location C:\Program Files\MongoDB 2.6 Standard to your user defined location, something without space in naming convention, this is a good practice. Copying the installed folder to another location will not create any issue as MongoDB is self-contained and does not have any other system dependencies. For example: C:\poc\mdb\MongoDB_2.6_Standard
  • Create a  mongo.cfg file with content:
##store data here (make sure you have manually created following directory)
dbpath=C:\poc\mdb\data

##all output go here (make sure you have manually created following directory)
logpath=C:\poc\mdb\log\mongo.log
  • Open command prompt (WIN +X ) and open Comman Prompt (Admin)
  • Type following:
sc.exe create MongoDB binPath= "\"C:\poc\mdb\MongoDB_2.6_Standard\bin\mongod.exe\" --service --config=\"C:\poc\mdb\mongod.cfg\"" DisplayName= "MongoDB_2.6_Standard" start= "auto" 
  • MongoDB service is successfully installed if you see following msg:
[SC] CreateService SUCCESS
  • Start MongoDB service:
net start MongoDB
  • To stop MongoDB service:
net stop MongoDB
  • To delete MongoDB service
sc.exe delete MongoDB

Source: http://www.mongodb.org

No comments:

Post a Comment