The installation of MongoDB

Source: Internet
Author: User
Tags install mongodb mongo shell

Install MongoDB 3.6 Community Edition

--Configuring the Yum source for MongoDB

    1. Vim/etc/yum.repos.d/mongodb-org-3.4.repo

--Add the following content:

[mongodb-org-3.6] name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/ mongodb-org/3.6/x86_64/Gpgcheck=1enabled=1gpgkey=https:// WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.6.ASC            

--Installing MongoDB

sudo yum install-y mongodb-org

Start MongoDB

--Configure SELinux

Method One:

If SELinux turns on enforcing mode:

    • 27017

Method Two:
If SELinux is disabled (the system must be restarted in such a way as to modify the configuration file):

SELINUX=disabled
Or
SELINUX=permissive
--Start MongoDB
    1. Systemctl Start Mongod.service


--Configure fire protection to add the 27017 port number to the exception:

    1. Firewall-cmd--permanent --add-port=27017/tcp

    1. Firewall-cmd--reload

    1. Systemctl Restart Firewalld.service

--Set Boot start

    1. Systemctl Enable Mongod.service


--Start MONGO shell

    1. Mongo

--Set up MongoDB remote access:

Edit mongod.conf Comment Bindip and restart MongoDB.

    1. Vim/etc/mongod.conf

    1. Systemctl Restart Mongod.service



--Stop MongoDB

      1. Systemctl Stop Mongod.service

The installation of 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.