Installing MongoDB in Linux and getting started

Source: Internet
Author: User
MongoDB is an open-source database project written by C ++ Based on Distributed File storage. It aims to provide a high-performance data storage solution that can be expanded for WEB applications. The following describes how to install and how to get started. Download to the official website mongodb.org to download the latest stable version, is currently mongodb-linux-i686-1.8.0.tgz

MongoDB is an open-source database project written by C ++ Based on Distributed File storage. It aims to provide a high-performance data storage solution that can be expanded for WEB applications. The following describes how to install and how to get started. Download to the official http://mongodb.org to download the latest stable version, is currently mongodb-linux-i686-1.8.0.tgz

MongoDB is an open-source database project written by C ++ Based on Distributed File storage. It aims to provide a high-performance data storage solution that can be expanded for WEB applications.

The following describes how to install and how to get started.

Download

Go to the official http://mongodb.org to download the latest stable version, is currently mongodb-linux-i686-1.8.0.tgz

Extract
mv mongodb-linux-i686-1.8.0.tgz /usr/local/cd /usr/localtar xvf mongodb-linux-i686-1.8.0.tgzmv mongodb-linux-i686-1.8.0 mondodbrm -y mongodb-linux-i686-1.8.0.tgz
Run

You need to create a directory for storing data (/data/db/by default), create a directory and start it:

mkdir -p /data/db//usr/local/mongodb/bin/mongod

If you want to use a specified directory to store data, add the-dbpath option:

/usr/local/mongodb/bin/mongod --dbpath /path/to/data/dir

Common Parameters

-- Port: Specifies the port. Default Value: 27017 -- dbpath: Specifies the data directory. Default Value:/data/db -- logpath: Specifies the Log Path, if not specified, the log is output to the command line. -- Logappend: When a log is created, the original file is overwritten. You can use this option to append the log. -- Fork: Run MongoDB -- rest as a daemon: enables the MongoDB rest api. You can use the default port + 1000 to manage the database. -- Config: Specify the configuration file
Use JavaScript Shell tools

The default link is the test database.

/usr/local/mongodb/bin/mongoMongoDB shell version: 1.8.0connecting to: test>
MongoDB Manual

Http://www.mongodb.org/display/DOCS/Manual

Original article address: Installing MongoDB in Linux and getting started. Thank you for sharing it with me.

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.