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

降低电脑性能Install MongoDB on Windows

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

OveviewUsethistutoialtoistallMogoDBoaWidowssystems.PLATFORMSUPPORTStatigivesio2.2,MogoDBdoesotsuppotWidowsXP.PleaseuseamoeecetvesioofWidows

Overview

UsethistutorialtoinstallMongoDBonaWindowssystems.PLATFORMSUPPORT

Startinginversion2.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.exe
ThisstartsthemainMongoDBdatabaseprocess.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.exe
Ifyouinstallationusesadifferentdatadirectory,specifythedirectorywhenconnecting,asinthisexample:

C:\mongodb\bin\mongod.exe--dbpathd:\test\mongodb\data
Ifyourpathincludesspaces,enclosetheentirepathindoublequotes.Forexample:

C:\mongodb\bin\mongod.exe--dbpath"d:\test\mongodbdata"
Ifyouwanttodevelopapplicationsusing.NET,seethedocumentationofC#andMongoDBformoreinformation.

BeginusingMongoDB.

TobeginusingMongoDB,seeGettingStartedwithMongoDB.AlsoconsidertheProductionNotesdocumentbeforedeployingMongoDBinaproductionenvironment.

ConfigureaWindowsServiceforMongoDB

NOTE

ThereisaknownissueforMongoDB2.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

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

  浙ICP备140365454号

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