用什么来启动mongodb的服务器
这篇文章主要介绍用什么来启动mongodb的服务器,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
在你的安装目录/bin下,有一个叫mongod.exe的应用程序,这个程序就是用来启动你的mongodb服务器的。
创建数据库目录
在你想要存放数据的地方,新建一个文件夹,如db,我们推荐的数据库目录设置是:
data/conf-->配置文件目录mongod.conf-->配置文件db-->数据库目录log-->日志文件目录mongodb.log-->日志记录文件
启动数据库:
我本地是window10环境,我的mongodb服务安装在F盘的mongodb文件夹。我的数据目录在F的data文件夹。
启动doc命令,输入一下命令:
F:\>mongodb/binF:\mongodb\bin>mongod--path=/data/db
输出以下信息:
2016-10-20T17:11:01.839+0800ICONTROL[initandlisten]MongoDBstarting:pid=1504port=27017dbpath=/data/db64-bithost=Haier-PC2016-10-20T17:11:01.842+0800ICONTROL[initandlisten]targetMinOS:Windows7/WindowsServer2008R22016-10-20T17:11:01.844+0800ICONTROL[initandlisten]dbversionv3.0.12-47-gd57ef6a2016-10-20T17:11:01.844+0800ICONTROL[initandlisten]gitversion:d57ef6a0c5a41729977f8d535a4c8de6d0cff8ba2016-10-20T17:11:01.844+0800ICONTROL[initandlisten]buildinfo:windowssys.getwindowsversion(major=6,minor=1,build=7601,platform=2,service_pack='ServicePack1')BOOST_LIB_VERSION=1_492016-10-20T17:11:01.844+0800ICONTROL[initandlisten]allocator:tcmalloc2016-10-20T17:11:01.844+0800ICONTROL[initandlisten]options:{storage:{dbPath:"/data/db"}}2016-10-20T17:11:01.860+0800IJOURNAL[initandlisten]journaldir=/data/db\journal2016-10-20T17:11:01.862+0800IJOURNAL[initandlisten]recover:nojournalfilespresent,norecoveryneeded2016-10-20T17:11:01.971+0800IJOURNAL[durability]Durabilitythreadstarted2016-10-20T17:11:01.972+0800IJOURNAL[journalwriter]Journalwriterthreadstarted2016-10-20T17:11:02.186+0800IINDEX[initandlisten]allocatingnewnsfile/data/db\local.ns,fillingwithzeroes...2016-10-20T17:11:02.553+0800ISTORAGE[FileAllocator]allocatingnewdatafile/data/db\local.0,fillingwithzeroes...2016-10-20T17:11:02.554+0800ISTORAGE[FileAllocator]creatingdirectory/data/db\_tmp2016-10-20T17:11:02.600+0800ISTORAGE[FileAllocator]doneallocatingdatafile/data/db\local.0,size:64MB,took0.012secs2016-10-20T17:11:02.654+0800INETWORK[initandlisten]waitingforconnectionsonport27017
最后一行显示"waiting for connections on port 27017",表明mongodb服务器已经启动,正在27017窗口等待连接。
以上是用什么来启动mongodb的服务器的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。