MongoDB是一個基於分布式檔案儲存體的資料庫,與Redis 同樣,基於NoSql 技術, 由C++語言編寫。旨在為WEB應用提供可擴充的高效能資料儲存解決方案,
下面為在ubuntu 上安裝及運行mongodb 過程。
1. 依賴包安裝,mongodb 用boost庫,js引擎(spider monkey 或者V8), Regex庫pcre.
apt-get -y install tcsh git-core scons g++apt-get -y install libpcre++-dev libboost-dev libreadline-dev xulrunner-1.9.2-devapt-get -y install libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev libboost-date-time-dev
2.編譯 2.1 擷取源碼,可以擷取主分支,也可以編譯子分支
git clone git://github.com/mongodb/mongo.gitcd mongo# pick a stable version unless doing true devgit tag -l# 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 r2.0.0
- 編譯
scons all
- 安裝
--prefix 指定 mongodb 庫存放位置
scons --prefix=/opt/mongo install
4. 運行
# sudo mkdir -p /data/db
# sudo ./mongod