Installing and uninstalling MongoDB 3.4 using the Yum source on CentOS 7

Source: Internet
Author: User

Installing and uninstalling MongoDB 3.4 using the Yum source on CentOS 7

1. Configure the Yum source

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

[mongodb-org-3.4]
Name=mongodb Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
Gpgcheck=1
Enabled=1
Gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

2. Installing MongoDB

Mongodb-org will contain mongodb-org-server, Mongodb-org-mongos, Mongodb-org-shell, Mongodb-org-tools

sudo yum install-y mongodb-org

3. Configure SELinux

Semanage port-a-t mongod_port_t-p TCP 27017

Or

Vi/etc/selinux/config

Selinux=disabled
Restart

Or

Vi/etc/selinux/config

Selinxu=permissive
Restart

4. Check data and log file access rights

The default data file in/var/lib/mongo, the default log file in/var/log/mongodb, is always granted Mongod user access when the file directory/etc/mongod.conf modified in the profile.

5. Modify Bind_ip

The default bind_ip is set to 127.0.0.1, modify as needed, and then restart the service.

6. Start the service

sudo chkconfig mongod on sudo service mongod start NETSTAT-TUNPL | grep 27017


Uninstalling MongoDB

The process will completely remove MongoDB, its configuration, and all databases.

1. Stop the Service

sudo service Mongod stop

2. Remove the Package

sudo yum erase $ (rpm-qa | grep mongodb-org)

3. Removing data and log files

sudo rm-r/var/log/mongodb sudo rm-r/var/lib/mongo


Reference:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

The source of this article: http://www.cgtblog.com/kafa/1589.html, reprint please indicate the source (spring Brother qq:2931393342: Wocgtblog)

Installing and uninstalling MongoDB 3.4 using the Yum source on CentOS 7

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.