[MongoDB] Learning notes--linux Installing and running MongoDB

Source: Internet
Author: User

Background knowledge

MongoDB is an open source, NoSQL (not just SQL) document database written in C + +.

Features: High performance (higher performance), high availability (highly reliable), and automatic scaling (auto-tuning).

The structure is similar to JSON.

Installation

1. Download the installation package Www.mongodb.org/downloads

Curl-o http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.3.tgz

2. Unpack the TGZ package

tar -zxvf mongodb-linux-x86_64-2.6. 3. tgz

3. Copy the extracted folder to the specified directory

Note the permissions, if prompted without permission, use sudo, or modify the directory's own.

mkdir -p mongodbcp -r-n mongodb-linux-x86_64-2.6. 3/MongoDB

4. Modify/etc/profile (valid for all users) or ~/.BASHRC (valid for current user), add mongodb/bin to path.

Export mongodb=/opt/mongodbexport PATH= $MONGODB/bin: $PATH

Note: If the operating system is Debian/redhat series, it can be installed through Apt-get/yum.

For more information, please refer to the official documentation: http://docs.mongodb.org/manual/administration/install-on-linux/

Run

5. Create the folder where the database is stored (it is recommended to change the following/data/db to the local storage path)

mkdir -p/data/db

6. Modify and confirm that the folder has read and modify permissions (user changed to your current user's name)

chown user/data/dborchmod777 /data/db

7. Run MongoDB (if you do not specify path, the default is/data/db, it is recommended to specify the pathname)

Mongod--dbpath <path to Data directory>

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.