CENTOS7 installation MongoDB3.4

Source: Internet
Author: User
Tags install mongodb mongo shell

1. Configure the Yum source for MongoDB
    • To create a Yum source file:
      vim /etc/yum.repos.d/mongodb-org-3.4.repo
    • Add the following content:
[mongodb-org-3.4]  name=MongoDB Repository  baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/  gpgcheck=0  enabled=1  gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
    • Update all packages before installing:
      yum update (可选操作)

      2. Installing MongoDB

      yum -y install mongodb-org

      3. Set Boot up

      systemctl enable mongod.service

      4. Set up MongoDB remote access:
    • Edit mongod.conf
      vim /etc/mongod.conf
    • Comment out the Bindip
    • and restart MongoDB.

      5. Common operation
    • Start Mongodb:systemctl start Mongod.service
    • Stop Mongodb:systemctl Stop Mongod.service
    • Find the status of MongoDB: Systemctl status Mongod.service

      6. Start the MONGO shell
    • Command: mongo Enter the shell
    • View database show dbs and more commands

At last

Hello everyone, this is "taoland", this blog is mainly used to record a rookie program ape Growth Road. This is my first time to do blog, hope and we have a lot of communication, grow together! The article will be updated synchronously at the following address ...
Personal blog: www.yangyuetao.cn
Small program: Taoland

CENTOS7 installation MongoDB3.4

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.