欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

MongoDB环境搭建

程序员文章站 2022-05-20 09:03:27
...

之前搭建过mongodb开发环境,操作系统都是在32位系统下。昨天找了张64位win7系统,在虚拟机上安装了,32位系统跑64位虚拟机,没问

之前搭建过mongodb开发环境,操作系统都是在32位系统下。昨天找了张64位win7系统,在虚拟机上安装了,32位系统跑64位虚拟机,没问题。开发环境还是在32位系统下,数据服务部署在了64位win7下。

一直以来用的是C/C++,mongodb的C++driver还得自己编译,,不过也方便。首先备齐软件,如下(引用):

Get the MongoDB Source Code
Download the source code from Downloads.

Or install Git. Then:

git clone git://github.com/mongodb/mongo.git (more info)
git tag -l to see tagged version numbers
Switch to a stable branch (unless doing development) -- an even second number indicates "stable". (Although with sharding you will want the latest if the latest is less than 1.6.0.) For example:
git checkout r1.4.1
Get Boost Libraries
Click here for a prebuilt boost library for Visual Studio. 7zip format. This file has what you need to build MongoDB, but not some other boost libs, so it's partial. Uncompress this to the c:\boost directory. Your actual files are in c:\boost\boost
See the Boost and Windows page for other options. Use v1.42 or higher with VS2010.
Get SpiderMonkey

Download prebuilt libraries and headers here for VS2010. Place these files in ../js/ relative to your mongo project directory.
Or (more work) build SpiderMonkey js.lib yourself – details here.

值得注意的是:

1、SCons安装:首先安装python,之后安装exe版的scons,然后将python的脚本路径添加到path下,如"C:\Python26\Scripts”。

2、在执行scons mongoclient.lib 时,可能会调用首先找到的VS环境,从而导致之后的test会调用多个版本的boost库,因此首先屏蔽掉vs2010以外的库(临时改名的方式)。

测试通过后,基本环境就是64位数据服务,32位调试环境。
下一篇着手矢量要素入库与效率分析。见

MongoDB环境搭建