Overview
UsethistutorialtoinstallMongoDBonaWindowssystems.PLATFORMSUPPORTStartinginversion2.2,MongoDBdoesnotsupportWindowsXP.PleaseuseamorerecentversionofWindowstousemorerecentreleasesofMongoDB.
IMPORTANT
IfyouarerunninganyeditionofWindowsServer2008R2orWindows7,pleaseinstallahotfixtoresolveanissuewithmemorymappedfilesonWindows.
InstallMongoDB
DeterminewhichMongoDBbuildyouneed.
TherearethreebuildsofMongoDBforWindows:MongoDBforWindowsServer2008R2edition(i.e.2008R2)runsonlyonWindowsServer2008R2,Windows764-bit,andnewerversionsofWindows.ThisbuildtakesadvantageofrecentenhancementstotheWindowsPlatformandcannotoperateonolderversionsofWindows.MongoDBforWindows64-bitrunsonany64-bitversionofWindowsnewerthanWindowsXP,includingWindowsServer2008R2andWindows764-bit.
MongoDBforWindows32-bitrunsonany32-bitversionofWindowsnewerthanWindowsXP.32-bitversionsofMongoDBareonlyintendedforoldersystemsandforuseintestinganddevelopmentsystems.32-bitversionsofMongoDBonlysupportdatabasessmallerthan2GB.TofindwhichversionofWindowsyouarerunning,enterthefollowingcommandintheCommandPrompt:
wmicosgetosarchitecture
DownloadMongoDBforWindows.
DownloadthelatestproductionreleaseofMongoDBfromtheMongoDBdownloadspage.EnsureyoudownloadthecorrectversionofMongoDBforyourWindowssystem.The64-bitversionsofMongoDBdoesnotworkwith32-bitWindows.Installthedownloadedfile.
InWindowsExplorer,locatethedownloadedMongoDBmsifile,whichtypicallyislocatedinthedefaultDownloadsfolder.Double-clickthemsifile.Asetofscreenswillappeartoguideyouthroughtheinstallationprocess.MovetheMongoDBfoldertoanotherlocation(optional).
TomovetheMongoDBfolder,youmustissuethemovecommandasanAdministrator.Forexample,tomovethefoldertoC:\mongodb:SelectStartMenu>AllPrograms>Accessories.
Right-clickCommandPromptandselectRunasAdministratorfromthepopupmenu.
Issuethefollowingcommands:
cd\ moveC:\mongodb-win32-*C:\mongodb
MongoDBisself-containedanddoesnothaveanyothersystemdependencies.YoucanrunMongoDBfromanyfolderyouchoose.YoumayinstallMongoDBinanyfolder(e.g.D:\test\mongodb)
002pc.com认为此文章对《降低电脑性能Install MongoDB on Windows》说的很在理。
RunMongoDB
WARNINGDonotmakemongod.exevisibleonpublicnetworkswithoutrunningin“SecureMode”withtheauthsetting.MongoDBisdesignedtoberunintrustedenvironments,andthedatabasedoesnotenable“SecureMode”bydefault.SetuptheMongoDBenvironment.
MongoDBrequiresadatadirectorytostorealldata.MongoDB’sdefaultdatadirectorypathis\data\db.CreatethisfolderusingthefollowingcommandsfromaCommandPrompt:md\data\db
Youcanspecifyanalternatepathfordatafilesusingthe--dbpathoptiontomongod.exe,forexample:
C:\mongodb\bin\mongod.exe--dbpathd:\test\mongodb\data
Ifyourpathincludesspaces,enclosetheentirepathindoublequotes,forexample:
C:\mongodb\bin\mongod.exe--dbpath"d:\test\mongodbdata"
StartMongoDB.
TostartMongoDB,runmongod.exe.Forexample,fromtheCommandPrompt:C:\ProgramFiles\MongoDB\bin\mongod.exeThisstartsthemainMongoDBdatabaseprocess.Thewaitingforconnectionsmessageintheconsoleoutputindicatesthatthemongod.exeprocessisrunningsuccessfully.
Dependingonthesecuritylevelofyoursystem,WindowsmaypopupaSecurityAlertdialogboxaboutblocking“somefeatures”ofC:\ProgramFiles\MongoDB\bin\mongod.exefromcommunicatingonnetworks.AllusersshouldselectPrivateNetworks,suchasmyhomeorworknetworkandclickAllowaccess.ForadditionalinformationonsecurityandMongoDB,pleaseseetheSecurityDocumentation.
ConnecttoMongoDB.
ToconnecttoMongoDBthroughthemongo.exeshell,openanotherCommandPrompt.Whenconnecting,specifythedatadirectoryifnecessary.Thisstepprovidesseveralexampleconnectioncommands.IfyourMongoDBinstallationusesthedefaultdatadirectory,connectwithoutspecifyingthedatadirectory:
C:\mongodb\bin\mongo.exeIfyouinstallationusesadifferentdatadirectory,specifythedirectorywhenconnecting,asinthisexample:
C:\mongodb\bin\mongod.exe--dbpathd:\test\mongodb\dataIfyourpathincludesspaces,enclosetheentirepathindoublequotes.Forexample:
C:\mongodb\bin\mongod.exe--dbpath"d:\test\mongodbdata"Ifyouwanttodevelopapplicationsusing.NET,seethedocumentationofC#andMongoDBformoreinformation.
BeginusingMongoDB.
TobeginusingMongoDB,seeGettingStartedwithMongoDB.AlsoconsidertheProductionNotesdocumentbeforedeployingMongoDBinaproductionenvironment.ConfigureaWindowsServiceforMongoDB
NOTEThereisaknownissueforMongoDB2.6.0,SERVER-13515,whichpreventstheuseoftheinstructionsinthissection.ForMongoDB2.6.0,useManuallyCreateaWindowsServiceforMongoDBtocreateaWindowsServiceforMongoDBinstead.
Configuredirectoriesandfiles.
CreateaconfigurationfileandadirectorypathforMongoDBlogoutput(logpath):CreateaspecificdirectoryforMongoDBlogfiles:
更多:降低电脑性能Install MongoDB on Windows
https://www.002pc.com/diannaojichu/862.html
你可能感兴趣的Windows,MongoDB,Install
