Linux Installation MongoDB

Source: Internet
Author: User
Tags mongodb

Download the installation package

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz

Extract

TAR-ZXVF mongodb-linux-x86_64-3.0.6.tgz

Put the unpacked installation package into the specified directory

MV mongodb-linux-x86_64-3.0.6//usr/local/mongodb

Add MongoDB executable file to Path

Export Path=/usr/local/mongodb/bin: $PATH

Create a folder to store data under the root directory

Mkdir-p/data/db

modifying environment variables

1. The CD to the root directory to execute the command

Vim ~/.bash_profile

2. Add Environment variables

Export path=${path}:/usr/local/mongodb/bin

: x Save

Source ~/.BASHRC Restart in effect

Start the database

Mongod

Connecting to a database

Mongo

MongoDB Background BootMongod-- Fork --logpath/usr/local/mongodb/logs --dbpath/data/db  --fork will start mongod as a background service and must follow --logpath Specify the log file path, if the log file does not exist it will be automatically created -- storage directory for DBPath data

------------------------------

Linux Installation MongoDB

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.