MongoDB is a distributed file storage-based database. Similar to redis, MongoDB is written in C ++ Based on nosql technology. Designed to provide scalable and high-performance data storage solutions for Web applications,
The following describes how to install and run MongoDB on Ubuntu.
1. Install the dependent package. MongoDB uses the boost library, JS engine (spider monkey or V8), and regular expression library 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. Compile 2.1 to get the source code. You can get the main branch or compile the sub branch.
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
- Compile
scons all
- Install
-- Prefix specifies the MongoDB inventory location
scons --prefix=/opt/mongo install
4. Run
# Sudo mkdir-P/data/DB
# Sudo./mongod