Install MongoDB on Ubuntu 12.04 Server

Source: Internet
Author: User
Tags install mongodb mongo shell

MongoDB (from "humongous") is an open-source document-oriented NoSQL database developed using C ++. The storage format is BSON, and the mode is free, featuring high performance, easy deployment, and easy to use, it is very convenient to store data. At present, a large number of developers have been used in the production environment.

Official website of MongoDB: http://www.mongodb.org/

How to install MongoDB on Ubuntu 12.04 (Precise) Server

Sudo apt-key adv-keyserver keyserver.ubuntu.com-recv 7F0CEB10
Echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee-a/etc/apt/sources. list. d/10gen. list
Sudo apt-get-y update

Sudo apt-get-y install mongodb-10gen

Configuration File:/etc/mongodb. conf

For Upstart-based systems, control scripts in/etc/init/mongodb. conf.

Default data file directory:/var/lib/mongodb

Default log file directory:/var/log/mongodb

Start MongoDB: sudo service mongodb start

Sudo service mongodb stop

Restart sudo service mongodb restart

Test: Run mongo on the terminal to open the mongo shell.

# Mongo
MongoDB shell version: 2.0.7
Connecting to: test

> Db. test. save ({a: 1 })
> Db. test. find ()
{"_ Id": ObjectId ("502b284cd9de55a0e9ca86d9"), "a": 1}

The reference source is here. I have installed the test on the Ubuntu 12.04 server version.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.