我这里准备的是r2.6.5的版本
下载地址:https://github.com/mongodb/mongo/tree/r2.6.5
测试环境是linux centeros 5.8版本 跟windows
windows下:
先把mongodb目录文件放到 其中一个盘上:例如 D:\mongoDB\
因为要安装一个数据库存储目录,这里我指定在 D:\mongoDB\mongoDatabase
然后进入到 dos命令界面中,进入到 mongoDB 目录中 下的 bin目录
例如: D:\mongoDB\bin>
然后是安装命令: mongod --dbpath D:\mongoDB\mongoDatabase
以上是安装指定mongodb的数据模块
D:\mongoDB\bin>mongod --dbpath D:\mongoDB\mongoDatabase
2015-05-13T15:06:14.788+0800 I CONTROL Hotfix KB2731284 or later update is not
installed, will zero-out data files
2015-05-13T15:06:14.798+0800 I JOURNAL [initandlisten] journal dir=D:\mongoDB\m
ongoDatabase\journal
2015-05-13T15:06:14.799+0800 I JOURNAL [initandlisten] recover : no journal fil
es present, no recovery needed
2015-05-13T15:06:14.825+0800 I JOURNAL [durability] Durability thread started
2015-05-13T15:06:14.826+0800 I JOURNAL [journal writer] Journal writer thread s
tarted
2015-05-13T15:06:14.867+0800 I CONTROL [initandlisten] MongoDB starting : pid=3
220 port=27017 dbpath=D:\mongoDB\mongoDatabase 64-bit host=SKY-20141762LCP
2015-05-13T15:06:14.867+0800 I CONTROL [initandlisten] targetMinOS: Windows Ser
ver 2003 SP2
2015-05-13T15:06:14.869+0800 I CONTROL [initandlisten] db version v3.0.2
2015-05-13T15:06:14.870+0800 I CONTROL [initandlisten] git version: 6201872043e
cbbc0a4cc169b5482dcf385fc464f
2015-05-13T15:06:14.871+0800 I CONTROL [initandlisten] build info: windows sys.
getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Servic
e Pack 1') BOOST_LIB_VERSION=1_49
2015-05-13T15:06:14.873+0800 I CONTROL [initandlisten] allocator: system
2015-05-13T15:06:14.874+0800 I CONTROL [initandlisten] options: { storage: { db
Path: "D:\mongoDB\mongoDatabase" } }
2015-05-13T15:06:15.140+0800 I NETWORK [initandlisten] waiting for connections
on port 27017
按回车之后会出现以上信息,表明数据库已经安装成功
这时候,进入到mongodb的bin目录下面:执行mongo
D:\mongoDB\bin>mongo
2015-05-13T15:54:41.565+0800 I CONTROL Hotfix KB2731284 or later update is not
installed, will zero-out data files
MongoDB shell version: 3.0.2
connecting to: test
>
以上则表明mongdb正常操作
先通过ssh把文件传到linux 系统中
然后进入到 放置文件的目录地址:例如: cd mongodb/mongo-r2.6.5, 然后再进行编译