Installing MongoDB under Linux

Source: Internet
Author: User

1. Download

Go to the official website https://www.mongodb.com find the corresponding version of MongoDB

Such a: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-4.0.0.tgz


2. Go to the Linux server to download it

1) Download: Curl-o https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-4.0.0.tgz

2) move to where you want to put it: mv mongodb-linux-x86_64-rhel62-4.0.0.tgz /usr/local/MongoDB

3) Go to the folder to unzip it:

CD/usr/local/mongodb

-zxvf MongoDB-linux-x86_64-3.0.  6.tgz

4) Adding MongoDB to the environment variable is to add the address of the bin directory under the folder of the MongoDB decompression to the environment variable, as follows:

Export PATH=/usr/local/mongodb/mongodb-linux-x86_64- rhel62-4.0.0/bin:$PATH     

Now it's installed.

3. Configure the data storage location for MongoDB

The default storage address for MongoDB is under the/data/db folder in the root directory, but this folder needs to be created by the user,

You can also modify this path by command, like this:

-/data/DBDB

After the configuration, you can try to start it.

4. Start MongoDB

In the DB directory of the MongoDB installation directory, execute the./mongod command, you can start MongoDB, you can see something like this when you start

This is started, and then you can use it, and the way to use it is listed in my ' Personal blog Development ' series.

Installing MongoDB under Linux

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.