CentOS7 on MongoDB Install, uninstall

Source: Internet
Author: User
Tags install mongodb mongodb

First, installation
1. Configuring the Yum Management Pack
1), create the file under Path/etc/yum.repos.d/Mongodb-org-3.4.repo
cd/etc/yum.repos.d/
Touch Mongodb-org-3.4.repo
2), write the following in the file 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
enable=1
GPGKEY=HTTPS://WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.4.ASC
2, install MongoDB (will install mongodb-org package and its dependent package mongodb-org-server, Mongodb-org-mongos, Mongodb-org-shell, Mongodb-org-tools)
The DB instance defaults to the/var/lib/mongo path, the log defaults to the/var/log/mongodb path, or you can modify the/etc/ Storage.dbpath and Systemlog.path configuration of mongod.conf files
Yum install-y mongodb-org
3. Open MongoDB Service
Service Mongod Start
4, check the log mode, verify that the service opened successfully, which has a behavior: [Thread1] waiting for connections on port 27017
Cat/var/log/mongodb/mongod.log
5. Set Boot start
chkconfig Mongod on
6. Stop MongoDB Service
Service Mongod Stop
7. Restart MongoDB Service
Service Mongod Restart

Second, uninstall
1. Stop the Service
Service Mongod Stop
2. Remove Installed Packages
Yum Erase $ (rpm-qa | grep mongodb-org)
3. Delete data and logs
Rm-r/var/log/mongodb
Rm-r/var/lib/mongo

CentOS7 on MongoDB Install, uninstall

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.