学习电脑,计算机系统故障维护,电脑技术,电脑知识学习-就上第二电脑网
当前位置: 首页 > 电脑知识 > 电脑基础

降低电脑性能Install MongoDB on Windows

 更新时间: 2019-08-11 20:42:51   作者:第二电脑网   来源:第二电脑网   浏览数:294   我要评论

OveviewUsethistutoialtoistallMogoDBoaWidowssystems.PLATFORMSUPPORTStatigivesio2.2,MogoDBdoesotsuppotWidowsXP.PleaseuseamoeecetvesioofWidows

md"C:\ProgramFiles\MongoDB\log"
IntheCommandPrompt,createaconfigurationfileforthelogpathoptionforMongoDB:

echologpath=C:\ProgramFiles\MongoDB\log\mongo.log>"C:\ProgramFiles\MongoDB\mongod.cfg"

RuntheMongoDBservice.

RunallofthefollowingcommandsinCommandPromptwith“AdministrativePrivileges:”

InstalltheMongoDBservice.For--installtosucceed,youmustspecifythelogpathrun-timeoption.

"C:\ProgramFiles\MongoDB\bin\mongod.exe"--config"C:\ProgramFiles\MongoDB\mongod.cfg"--install
Modifythepathtothemongod.cfgfileasneeded.

Touseanalternatedbpath,specifythepathintheconfigurationfile(e.g.C:\ProgramFiles\MongoDB\mongod.cfg)oronthecommandlinewiththe--dbpathoption.

Ifthedbpathdirectorydoesnotexist,mongod.exewillnotstart.Thedefaultvaluefordbpathis\data\db.Ifneeded,youcaninstallservicesformultipleinstancesofmongod.exeormongos.exe.Installeachservicewithaunique--serviceNameand--serviceDisplayName.Usemultipleinstancesonlywhensufficientsystemresourcesexistandyoursystemdesignrequiresit.

StoporremovetheMongoDBserviceasneeded.

TostoptheMongoDBserviceusethefollowingcommand:
netstopMongoDB

ToremovetheMongoDBserviceusethefollowingcommand:

"C:\ProgramFiles\MongoDB\bin\mongod.exe"--remove
ManuallyCreateaWindowsServiceforMongoDB

ThefollowingprocedureassumesyouhaveinstalledMongoDBusingtheMSIinstaller,withthedefaultpathC:\ProgramFiles\MongoDB2.6Standard.

Ifyouhaveinstalledinanalternativedirectory,youwillneedtoadjustthepathsasappropriate.

OpenanAdministratorcommandprompt.

Windows7/Vista/Server2008(andR2)

PressWin+R,thentypecmd,thenpressCtrl+Shift+Enter.

Windows8

PressWin+X,thenpressA.

ExecutetheremainingstepsfromtheAdministratorcommandprompt.

Createdirectories.

Createdirectoriesforyourdatabaseandlogfiles:
mkdirc:\data\db
mkdirc:\data\log

Createaconfigurationfile.

Createaconfigurationfile.Thisfilecanincludeanyoftheconfigurationoptionsformongod,butmustincludeavalidsettingforlogpath:

Thefollowingcreatesaconfigurationfile,specifyingboththelogpathandthedbpathsettingsintheconfigurationfile:

echologpath=c:\data\log\mongod.log>"C:\ProgramFiles\MongoDB2.6Standard\mongod.cfg"echodbpath=c:\data\db>>"C:\ProgramFiles\MongoDB2.6Standard\mongod.cfg"

CreatetheMongoDBservice.

CreatetheMongoDBservice.
sc.execreateMongoDBbinPath="\"C:\ProgramFiles\MongoDB2.6Standard\bin\mongod.exe\"--service--config=\"C:\ProgramFiles\MongoDB2.6Standard\mongod.cfg\""DisplayName="MongoDB2.6Standard"start="auto"

sc.exerequiresaspacebetween“=”andtheconfigurationvalues(eg“binPath=”),anda“”toescapedoublequotes.

Ifsuccessfullycreated,thefollowinglogmessagewilldisplay:

[SC]CreateServiceSUCCESS

5

StarttheMongoDBservice.

netstartMongoDB

6

StoporremovetheMongoDBserviceasneeded.

TostoptheMongoDBservice,usethefollowingcommand:
netstopMongoDB

ToremovetheMongoDBservice,firststoptheserviceandthenrunthefollowingcommand:

sc.exedeleteMongoDB

更多:降低电脑性能Install MongoDB on Windows
https://www.002pc.com/diannaojichu/862.html

你可能感兴趣的Windows,MongoDB,Install

关于我们 - 广告合作 - 联系我们 - 免责声明 - 网站地图 - 投诉建议 - 在线投稿

  浙ICP备140365454号

©CopyRight 2008-2020 002pc.COM Inc All Rights Reserved. 第二电脑网 版权所有 联系QQ:282523118