10gen provides MongoDB's. deb package version, making it easy to install on ubuntu. Although Ubuntu also provides a MongoDB package, the MongoDB version of its package management is somewhat
10gen provides MongoDB's. deb package version, making it easy to install on ubuntu. Although Ubuntu also provides a MongoDB package, the MongoDB version of its package management is somewhat
I. Requirements
MongoDB version: 2.4.3
Ubuntu version: 13.04
Ii. Description
10gen provides MongoDB's. deb package version, making it easy to install on ubuntu. Although Ubuntu also provides a MongoDB package, the MongoDB version managed by its package is a little old and cannot be installed with the latest version. Therefore, the latest version must be installed on the official website.
10gen provides a mongodb-10gen package that includes the latest MongoDB stable version and also provides the mongodb-clients package.
Iii. Installation
1. Configure the package management system
Ubuntu's package management tools (such as dpkg or apt) Ensure package consistency and authorization.
$ Sudo apt-key adv -- keyserver keyserver.ubuntu.com -- recv 7F0CEB10
[Sudo] password for chszs:
Executing: gpg -- ignore-time-conflict -- no-options -- no-default-keyring -- secret-keyring/tmp. tpL2Sensb5 -- trustdb-name/etc/apt // trustdb. gpg -- keyring/etc/apt/trusted. gpg -- primary-keyring/etc/apt/trusted. gpg -- keyserver keyserver.ubuntu.com -- recv 7F0CEB10
Gpg: Download the secret '7f0ceb10' from hkp server keyserver.ubuntu.com
Gpg: Key 7F0CEB10: Public Key "Richard Kreuter "Imported
Gpg: no key absolutely trusted
Gpg: Total number of processed items: 1
Gpg: imported: 1 (RSA: 1)
Create the/etc/apt/sources. list. d/10gen. list file, which contains the following content:
$ Echo 'deb dist 10gen '| sudo tee/etc/apt/sources. list. d/10gen. list
Deb dist 10gen
Use the following command to update the software library:
$ Sudo apt-get update
Run the following command to install the latest stable version of MongoDB:
$ Sudo apt-get install mongodb-10gen
After the command is executed, MongoDB is installed.
4. Installation of the specified version
You can install an earlier version of MongoDB using a mongodb-10gen package. To install the specified version, you can:
$ Apt-get install mongodb-10gen = 2.2.3
Note that during use, it is possible that when you install other software, apt-get will automatically upgrade your mongodb-10gen package, to prevent the upgrade, you need to use this command:
$ Echo "mongodb-10gen hold" | dpky -- set-selections
5. Configure MongoDB
You can configure mongodb through the/etc/MongoDB. conf file. The control script is in/etc/init. d/mongodb.
MongoDB instances store data in/var/lib/mongodb data files, and logs are recorded in/var/log/mongodb log files.