MongoDB Configuration Concise Documentation

Source: Internet
Author: User
Tags documentation mongodb client

1. Download MongoDB Package (RHEL 7 Linux 64-bit x64)

[Email protected]/]# wget-p/usr/local/src/https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.0.1.tgz

2. Unpack the package:

[Email protected]/]# TAR-XZVF mongodb-linux-x86_64-rhel70-4.0.1.tgz-c/usr/local/src/[[email protected]/]# mv/usr/l Ocal/src/mongodb-linux-x86_64-rhel70-4.0.1/usr/local/mongodb

3. Create the directory required for the program to run:

[Email protected]/]# Mkdir/usr/local/mongodb/etc/usr/local/mongodb/data/usr/local/mongodb/log

4. Create a MongoDB configuration file:

[Email protected]/]# Vim/usr/local/mongodb/etc/mongod.confdbpath =/usr/local/mongodb/data/logpath =/usr/local/ Mongodb/log/mongodb.logpidfilepath =/usr/local/mongodb/log/mongodb.pidbind_ip = 127.0.0.1port = 27017fork = True

5. Start the MongoDB program:

[Email protected]/]#/usr/local/mongodb/bin/mongod-f/usr/local/mongodb/etc/mongod.conf

6. MongoDB added to the system environment variable:

[Email protected]/]# sed-i ' $a export mongodb_home=/usr/local/mongodb\nexport path= $MONGODB _home/bin: $PATH '/etc/ Profile
[Email protected]/]# Source/etc/profile

7. MongoDB Client Login:

[[email protected]/]# mongomongodb Shell version v4.0.1connecting to:mongodb://127.0.0.1:27017mongodb server Version:4 .0.1

[The END]

MongoDB Configuration Concise Documentation

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.